forked from mirror/sjson
Merge pull request #28 from donatello/fix-err-shadow
Fix error variable shadowing
This commit is contained in:
commit
25fb082a20
|
@ -116,9 +116,9 @@ func SetBytesOptions(json []byte, path string, value interface{},
|
||||||
var err error
|
var err error
|
||||||
switch v := value.(type) {
|
switch v := value.(type) {
|
||||||
default:
|
default:
|
||||||
b, err := jsongo.Marshal(value)
|
b, merr := jsongo.Marshal(value)
|
||||||
if err != nil {
|
if merr != nil {
|
||||||
return nil, err
|
return nil, merr
|
||||||
}
|
}
|
||||||
// raw := *(*string)(unsafe.Pointer(&b))
|
// raw := *(*string)(unsafe.Pointer(&b))
|
||||||
raw := string(b)
|
raw := string(b)
|
||||||
|
|
|
@ -115,9 +115,9 @@ func SetBytesOptions(json []byte, path string, value interface{},
|
||||||
var err error
|
var err error
|
||||||
switch v := value.(type) {
|
switch v := value.(type) {
|
||||||
default:
|
default:
|
||||||
b, err := jsongo.Marshal(value)
|
b, merr := jsongo.Marshal(value)
|
||||||
if err != nil {
|
if merr != nil {
|
||||||
return nil, err
|
return nil, merr
|
||||||
}
|
}
|
||||||
raw := *(*string)(unsafe.Pointer(&b))
|
raw := *(*string)(unsafe.Pointer(&b))
|
||||||
res, err = set(jstr, path, raw, false, false, optimistic, inplace)
|
res, err = set(jstr, path, raw, false, false, optimistic, inplace)
|
||||||
|
|
Loading…
Reference in New Issue