go: Use errors.Is over ==
Client: go
Fix 2 instances we are using == to check on error but should have used
errors.Is instead.
diff --git a/lib/go/thrift/header_transport.go b/lib/go/thrift/header_transport.go
index 3aea5a9..772d922 100644
--- a/lib/go/thrift/header_transport.go
+++ b/lib/go/thrift/header_transport.go
@@ -128,7 +128,7 @@
//
// If you don't know the closers capacity beforehand, just use
//
-// &TransformReader{Reader: baseReader}
+// &TransformReader{Reader: baseReader}
//
// instead would be sufficient.
func NewTransformReaderWithCapacity(baseReader io.Reader, capacity int) *TransformReader {
@@ -544,7 +544,7 @@
// the last Read finished the frame, do endOfFrame
// handling here.
err = t.endOfFrame()
- } else if err == io.EOF {
+ } else if errors.Is(err, io.EOF) {
err = t.endOfFrame()
if err != nil {
return
diff --git a/lib/go/thrift/simple_json_protocol.go b/lib/go/thrift/simple_json_protocol.go
index da12248..f7fe68c 100644
--- a/lib/go/thrift/simple_json_protocol.go
+++ b/lib/go/thrift/simple_json_protocol.go
@@ -1195,7 +1195,7 @@
for continueFor {
c, err := p.reader.ReadByte()
if err != nil {
- if err == io.EOF {
+ if errors.Is(err, io.EOF) {
break
}
return NUMERIC_NULL, NewTProtocolException(err)