-
Notifications
You must be signed in to change notification settings - Fork 321
New issue
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
golangci-lint reports issues #281
Comments
Yes, there's a bunch of stuff to untangle here. CC @kakkoyun |
This has become a nuisance. For now, I'm going to add comments to turn off the errors. |
mem
added a commit
that referenced
this issue
Jul 15, 2021
The linter is correctly flagging this bit: fmt.Fprintf(w, ExpectedMessage) because it's a formatting function that doesn't appear to be formatting anything (since there are not additional arguments after the formatting string). staticcheck has started flagging this import: "github.com/golang/protobuf/proto" because that package has been rewritten and published as google.golang.org/protobuf. The new package is not a drop-in replacement for the old one, even if the staticcheck diagnostic suggests otherwise. Newer versions of the old package are actually implemented in terms of the new one. For this code base in particular, some of the text marshalling functions have disappeared in the new package and they need to be implemented in terms of the new reflection package. Until an adequate solution is found, simply ignore the error. Closes: #281 Signed-off-by: Marcelo E. Magallon <marcelo.magallon@grafana.com>
This was referenced Jul 15, 2021
Merged
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
the first two are simple, the others not so much.
The reason why these packages import
github.com/golang/protobuf/proto
is to have access toproto.MarshalTextString
, which has been removed. That's replaced byprototext.Marshal
, but that in turn requires that the Go code be generated with a newer protoc-gen-go, so this affectsprometheus/client_model
.The text was updated successfully, but these errors were encountered: