We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
DefaultParameters
I think DefaultParameters tend to be unintentionally mutated. Because DefaultParameters is a pointer, following code will pollute it.
params := winrm.DefaultParameters params.Timeout = timeout // ⚠️ Ouch! winrm.DefaultParameters is also changed!
You can see such codes even in README.md.
winrm/README.md
Lines 139 to 140 in e811dad
I also put a real-world example here. https://github.com/hashicorp/terraform/blob/8f7744da0959334f461c18ccf15f8b19d8c09fe6/internal/communicator/winrm/communicator.go#L63-L64
The text was updated successfully, but these errors were encountered:
I suggest to add something like NewDefaultParameters() and add // Deprecated into DefaultParameters.
NewDefaultParameters()
// Deprecated
Sorry, something went wrong.
No branches or pull requests
I think
DefaultParameters
tend to be unintentionally mutated. BecauseDefaultParameters
is a pointer, following code will pollute it.You can see such codes even in README.md.
winrm/README.md
Lines 139 to 140 in e811dad
I also put a real-world example here.
https://github.com/hashicorp/terraform/blob/8f7744da0959334f461c18ccf15f8b19d8c09fe6/internal/communicator/winrm/communicator.go#L63-L64
The text was updated successfully, but these errors were encountered: