From a230cb15d8fd414daa993f2fbca55d86beb93c1e Mon Sep 17 00:00:00 2001 From: Matt Lord Date: Sat, 21 Dec 2024 12:37:05 -0500 Subject: [PATCH] Error nits (send halp) Signed-off-by: Matt Lord --- go/mysql/binlog/binlog_json.go | 4 ++-- go/test/utils/binlog.go | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/go/mysql/binlog/binlog_json.go b/go/mysql/binlog/binlog_json.go index 5d132ff81d1..ed3a4ac646b 100644 --- a/go/mysql/binlog/binlog_json.go +++ b/go/mysql/binlog/binlog_json.go @@ -140,8 +140,8 @@ func ParseBinaryJSONDiff(data []byte) (sqltypes.Value, error) { pos = readTo value, err := ParseBinaryJSON(data[pos : pos+valueLen]) if err != nil { - return sqltypes.Value{}, vterrors.Errorf(vtrpcpb.Code_INVALID_ARGUMENT, - "cannot read JSON diff value for path %s: %v", path, err) + return sqltypes.Value{}, vterrors.Wrapf(err, + "cannot read JSON diff value for path %q", path) } pos += valueLen if value.Type() == json.TypeString { diff --git a/go/test/utils/binlog.go b/go/test/utils/binlog.go index 0db6929054c..6e43dd511ad 100644 --- a/go/test/utils/binlog.go +++ b/go/test/utils/binlog.go @@ -17,6 +17,7 @@ limitations under the License. package utils import ( + "errors" "fmt" "os" "strconv" @@ -61,7 +62,7 @@ func SetBinlogRowImageOptions(mode string, partialJSON bool, cnfDir string) erro } if partialJSON { if !CIDBPlatformIsMySQL8orLater() { - return fmt.Errorf("partial JSON values are only supported in MySQL 8.0 or later") + return errors.New("partial JSON values are only supported in MySQL 8.0 or later") } // We're testing partial binlog row images so let's also test partial // JSON values in the images.