chore: bump golangci-lint and fix all linting issues (#21761)
This commit is contained in:
@@ -3,10 +3,9 @@ package gogoreflection
|
||||
import (
|
||||
"reflect"
|
||||
|
||||
_ "github.com/cosmos/cosmos-proto" // look above
|
||||
_ "github.com/cosmos/gogoproto/gogoproto" // required so it does register the gogoproto file descriptor
|
||||
gogoproto "github.com/cosmos/gogoproto/proto"
|
||||
|
||||
_ "github.com/cosmos/cosmos-proto" // look above
|
||||
"github.com/golang/protobuf/proto" //nolint:staticcheck // migrate in a future pr
|
||||
)
|
||||
|
||||
@@ -42,12 +41,12 @@ func getExtension(extID int32, m proto.Message) *gogoproto.ExtensionDesc {
|
||||
for id, desc := range proto.RegisteredExtensions(m) { //nolint:staticcheck // keep for backward compatibility
|
||||
if id == extID {
|
||||
return &gogoproto.ExtensionDesc{
|
||||
ExtendedType: desc.ExtendedType, //nolint:staticcheck // keep for backward compatibility
|
||||
ExtensionType: desc.ExtensionType, //nolint:staticcheck // keep for backward compatibility
|
||||
Field: desc.Field, //nolint:staticcheck // keep for backward compatibility
|
||||
Name: desc.Name, //nolint:staticcheck // keep for backward compatibility
|
||||
Tag: desc.Tag, //nolint:staticcheck // keep for backward compatibility
|
||||
Filename: desc.Filename, //nolint:staticcheck // keep for backward compatibility
|
||||
ExtendedType: desc.ExtendedType,
|
||||
ExtensionType: desc.ExtensionType,
|
||||
Field: desc.Field,
|
||||
Name: desc.Name,
|
||||
Tag: desc.Tag,
|
||||
Filename: desc.Filename,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -188,7 +188,7 @@ func fqn(prefix, name string) string {
|
||||
// fileDescForType gets the file descriptor for the given type.
|
||||
// The given type should be a proto message.
|
||||
func (s *serverReflectionServer) fileDescForType(st reflect.Type) (*dpb.FileDescriptorProto, error) {
|
||||
m, ok := reflect.Zero(reflect.PtrTo(st)).Interface().(protoMessage)
|
||||
m, ok := reflect.Zero(reflect.PointerTo(st)).Interface().(protoMessage)
|
||||
if !ok {
|
||||
return nil, fmt.Errorf("failed to create message from type: %v", st)
|
||||
}
|
||||
@@ -236,7 +236,7 @@ func typeForName(name string) (reflect.Type, error) {
|
||||
}
|
||||
|
||||
func fileDescContainingExtension(st reflect.Type, ext int32) (*dpb.FileDescriptorProto, error) {
|
||||
m, ok := reflect.Zero(reflect.PtrTo(st)).Interface().(gogoproto.Message)
|
||||
m, ok := reflect.Zero(reflect.PointerTo(st)).Interface().(gogoproto.Message)
|
||||
if !ok {
|
||||
return nil, fmt.Errorf("failed to create message from type: %v", st)
|
||||
}
|
||||
@@ -251,7 +251,7 @@ func fileDescContainingExtension(st reflect.Type, ext int32) (*dpb.FileDescripto
|
||||
}
|
||||
|
||||
func (s *serverReflectionServer) allExtensionNumbersForType(st reflect.Type) ([]int32, error) {
|
||||
m, ok := reflect.Zero(reflect.PtrTo(st)).Interface().(gogoproto.Message)
|
||||
m, ok := reflect.Zero(reflect.PointerTo(st)).Interface().(gogoproto.Message)
|
||||
if !ok {
|
||||
return nil, fmt.Errorf("failed to create message from type: %v", st)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user