-
Notifications
You must be signed in to change notification settings - Fork 134
Open
Description
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.
Lines 139 to 140 in e811dad
| params := DefaultParameters | |
| params.TransportDecorator = func() Transporter { return &ClientNTLM{} } |
I also put a real-world example here.
https://github.com/hashicorp/terraform/blob/8f7744da0959334f461c18ccf15f8b19d8c09fe6/internal/communicator/winrm/communicator.go#L63-L64
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels