From 8ab98462aaa8480eafd5b5726cd26060ccf1e981 Mon Sep 17 00:00:00 2001 From: HeyJavaBean Date: Wed, 11 Dec 2024 17:52:33 +0800 Subject: [PATCH] fix: fix name --- protocol/thrift/apache/adaptor/struct_codec.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/protocol/thrift/apache/adaptor/struct_codec.go b/protocol/thrift/apache/adaptor/struct_codec.go index 50076d5..4d4dc48 100644 --- a/protocol/thrift/apache/adaptor/struct_codec.go +++ b/protocol/thrift/apache/adaptor/struct_codec.go @@ -25,7 +25,7 @@ type fastReader interface { FastRead(buf []byte) (int, error) } -const OldFastWriteMethod = "FastWriteNocopy" +const oldFastWriteMethod = "FastWriteNocopy" func toFastCodec(p interface{}) (thrift.FastCodec, error) { // if struct is from kitex_gen which is generated higher than v0.10.0,just assert gopkg thrift.FastCodec @@ -42,10 +42,10 @@ func toFastCodec(p interface{}) (thrift.FastCodec, error) { return nil, fmt.Errorf("no BLength method for struct") } - method := reflect.ValueOf(p).MethodByName(OldFastWriteMethod) + method := reflect.ValueOf(p).MethodByName(oldFastWriteMethod) if !method.IsValid() { - return nil, fmt.Errorf("method not found or not exported: %s", OldFastWriteMethod) + return nil, fmt.Errorf("method not found or not exported: %s", oldFastWriteMethod) } if method.Type().NumIn() != 2 {