chore: fix linting issues exposed by fixing golangci-lint (#12895)
Co-authored-by: Marko <marbar3778@yahoo.com> Co-authored-by: Julien Robert <julien@rbrt.fr>
This commit is contained in:
co-authored by
Marko
Julien Robert
parent
15b04c2a87
commit
0943a70215
@@ -9,7 +9,7 @@ import (
|
||||
_ "github.com/gogo/protobuf/gogoproto" // required so it does register the gogoproto file descriptor
|
||||
gogoproto "github.com/gogo/protobuf/proto"
|
||||
|
||||
// nolint: staticcheck
|
||||
//nolint: staticcheck
|
||||
"github.com/golang/protobuf/proto"
|
||||
dpb "github.com/golang/protobuf/protoc-gen-go/descriptor"
|
||||
_ "github.com/regen-network/cosmos-proto" // look above
|
||||
@@ -60,7 +60,8 @@ func init() {
|
||||
}
|
||||
|
||||
// compress compresses the given file descriptor
|
||||
// nolint: interfacer
|
||||
//
|
||||
//nolint:interfacer
|
||||
func compress(fd *dpb.FileDescriptorProto) ([]byte, error) {
|
||||
fdBytes, err := proto.Marshal(fd)
|
||||
if err != nil {
|
||||
@@ -86,7 +87,7 @@ func getFileDescriptor(filePath string) []byte {
|
||||
if len(fd) != 0 {
|
||||
return fd
|
||||
}
|
||||
// nolint: staticcheck
|
||||
//nolint: staticcheck
|
||||
return proto.FileDescriptor(filePath)
|
||||
}
|
||||
|
||||
@@ -95,7 +96,7 @@ func getMessageType(name string) reflect.Type {
|
||||
if typ != nil {
|
||||
return typ
|
||||
}
|
||||
// nolint: staticcheck
|
||||
//nolint: staticcheck
|
||||
return proto.MessageType(name)
|
||||
}
|
||||
|
||||
@@ -107,7 +108,7 @@ func getExtension(extID int32, m proto.Message) *gogoproto.ExtensionDesc {
|
||||
}
|
||||
}
|
||||
// check into proto registry
|
||||
// nolint: staticcheck
|
||||
//nolint: staticcheck
|
||||
for id, desc := range proto.RegisteredExtensions(m) {
|
||||
if id == extID {
|
||||
return &gogoproto.ExtensionDesc{
|
||||
@@ -133,7 +134,7 @@ func getExtensionsNumbers(m proto.Message) []int32 {
|
||||
if len(out) != 0 {
|
||||
return out
|
||||
}
|
||||
// nolint: staticcheck
|
||||
//nolint: staticcheck
|
||||
protoExts := proto.RegisteredExtensions(m)
|
||||
out = make([]int32, 0, len(protoExts))
|
||||
for id := range protoExts {
|
||||
|
||||
@@ -23,6 +23,7 @@ The service implemented is defined in:
|
||||
https://github.com/grpc/grpc/blob/master/src/proto/grpc/reflection/v1alpha/reflection.proto.
|
||||
|
||||
To register server reflection on a gRPC server:
|
||||
|
||||
import "google.golang.org/grpc/reflection"
|
||||
|
||||
s := grpc.NewServer()
|
||||
@@ -32,7 +33,6 @@ To register server reflection on a gRPC server:
|
||||
reflection.Register(s)
|
||||
|
||||
s.Serve(lis)
|
||||
|
||||
*/
|
||||
package gogoreflection // import "google.golang.org/grpc/reflection"
|
||||
|
||||
@@ -46,7 +46,7 @@ import (
|
||||
"sort"
|
||||
"sync"
|
||||
|
||||
// nolint: staticcheck
|
||||
//nolint: staticcheck
|
||||
"github.com/golang/protobuf/proto"
|
||||
dpb "github.com/golang/protobuf/protoc-gen-go/descriptor"
|
||||
"google.golang.org/grpc"
|
||||
|
||||
Reference in New Issue
Block a user