Skip to content

Commit

Permalink
fix: fix name
Browse files Browse the repository at this point in the history
  • Loading branch information
HeyJavaBean committed Dec 11, 2024
1 parent 4a1f084 commit 8ab9846
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions protocol/thrift/apache/adaptor/struct_codec.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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 {
Expand Down

0 comments on commit 8ab9846

Please sign in to comment.