forked from mirror/sjson
Fix error variable shadowing
This commit is contained in:
parent
c943cc8c8d
commit
d46b5fa72e
|
@ -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)
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue