Closed zhijianli88 closed 3 years ago
there is a false report in where it assigns to a receiver
https://github.com/kubernetes/test-infra/blob/master/def/configmap/main.go#L64
func (mkv *multiKeyValue) Set(v string) error { p := strings.SplitN(v, "=", 2) if len(p) != 2 { return fmt.Errorf("%s does not match label=value", v) } if mkv == nil { mkv = &multiKeyValue{ p[0]: p[1], } } else { (*mkv)[p[0]] = p[1] } return nil }
Assigning to a receiver works the same way as assigning to a parameter: its effect is only visible within the function scope.
What you want is
*mkv = multiKeyValue{ p[0]: p[1], }
there is a false report in where it assigns to a receiver
https://github.com/kubernetes/test-infra/blob/master/def/configmap/main.go#L64