From d46b5fa72efcbe26f44efa7239e9db4a3b641171 Mon Sep 17 00:00:00 2001 From: Aditya Manthramurthy Date: Thu, 28 Feb 2019 12:16:16 -0800 Subject: [PATCH] Fix error variable shadowing --- sjson_gae.go | 6 +++--- sjson_ngae.go | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/sjson_gae.go b/sjson_gae.go index 4b83a17..eaba00e 100644 --- a/sjson_gae.go +++ b/sjson_gae.go @@ -116,9 +116,9 @@ func SetBytesOptions(json []byte, path string, value interface{}, var err error switch v := value.(type) { default: - b, err := jsongo.Marshal(value) - if err != nil { - return nil, err + b, merr := jsongo.Marshal(value) + if merr != nil { + return nil, merr } // raw := *(*string)(unsafe.Pointer(&b)) raw := string(b) diff --git a/sjson_ngae.go b/sjson_ngae.go index f3624f4..6f47a04 100644 --- a/sjson_ngae.go +++ b/sjson_ngae.go @@ -115,9 +115,9 @@ func SetBytesOptions(json []byte, path string, value interface{}, var err error switch v := value.(type) { default: - b, err := jsongo.Marshal(value) - if err != nil { - return nil, err + b, merr := jsongo.Marshal(value) + if merr != nil { + return nil, merr } raw := *(*string)(unsafe.Pointer(&b)) res, err = set(jstr, path, raw, false, false, optimistic, inplace)