Open dlsniper opened 8 years ago
Hi. If I have the following and it raises inspection warning "Assignment to method receiver propagates only to callees but not to callers":
type Test struct {}
func (t *Test) Modify() {
(*t) = Test{}
}
what's wrong with that? I don't fully understand the meaning of the inspection message in this case.
In go, we need to assign to pointer receiver, in cases such as UnmarshalText(), UnmarshalXML() etc., how else we could achieve the same result?
What am I missing?
The inspection reports
Assignment to method receiver doesn't propagate to other calls
orAssignment to method receiver propagates only to callees but not to callers
but there's no good way that I can think of to solve this. Suggestions are welcomed.