encoding/json: Unmarshal an interface pointer bug #21494
Closed
Labels
Comments
This is happening because the type of Closing because I don't think there is anything to fix here. Please comment if you disagree. |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
go version
go1.8.3 linux/amd64
go env
GOARCH="amd64"
GOBIN=""
GOEXE=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOOS="linux"
GOPATH="/home/xing/go"
GORACE=""
GOROOT="/usr/local/go"
GOTOOLDIR="/usr/local/go/pkg/tool/linux_amd64"
GCCGO="gccgo"
CC="gcc"
GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build248645349=/tmp/go-build -gno-record-gcc-switches"
CXX="g++"
CGO_ENABLED="1"
PKG_CONFIG="pkg-config"
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
So we can see json.Unmarshal will change the type of 'b' from Test to map[string]interface{}
Reason :
encoding/json/decode.go function indirect (line 439)
Thanks
The text was updated successfully, but these errors were encountered: