Congrats with the new release!
Compiled with Go version: go1.26.0
Main module:
honnef.co/go/[email protected] (sum: h1:w6WUp1VbkqPEgLz4rkBzH/CSU6HkoqNLp6GstyTx3lU=)
Dependencies:
github.com/BurntSushi/[email protected] (sum: h1:dRaEfpa2VI55EwlIW72hMRHdWouJeRF7TPYhI+AUQjk=)
golang.org/x/exp/[email protected] (sum: h1:6Wi43P0isP8Nl8D4qJmA3VC4FswVH0RJkr5cauo67SQ=)
golang.org/x/[email protected] (sum: h1:tHFzIWbBifEmbwtGz65eaWyGiGZatSrT9prnU8DbVL8=)
golang.org/x/[email protected] (sum: h1:vV+1eWNmZ5geRlYjzm2adRgW2/mcpevXNg50YZtPCE4=)
golang.org/x/[email protected] (sum: h1:uNgphsn75Tdz5Ji2q36v/nsFSfR/9BRFvqhGBaJGd5k=)
Code generators like protobuf will often create code that doesn't comply with the Go naming conventions. For example, a protobuf field like user_id will be turned into UserId. The same goes for gRPC method names, that is things like getUserById.
In order to implement the interfaces that gRPC generates, users need to define their own methods, but staticcheck currently triggers ST1003 on them, even when a check like
var _ generatedpb.UserServer = (*myUserServer)(nil)
is present.
For some examples, see:
If staticcheck could see that the interface being implemented is from an autogenerated file, the lint:ignore directives wouldn't be necessary.
Congrats with the new release!
Code generators like protobuf will often create code that doesn't comply with the Go naming conventions. For example, a protobuf field like
user_idwill be turned intoUserId. The same goes for gRPC method names, that is things likegetUserById.In order to implement the interfaces that gRPC generates, users need to define their own methods, but
staticcheckcurrently triggers ST1003 on them, even when a check likeis present.
For some examples, see:
If
staticcheckcould see that the interface being implemented is from an autogenerated file, thelint:ignoredirectives wouldn't be necessary.