You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The text was updated successfully, but these errors were encountered:
Prakhar-FF13
changed the title
affected/package: json
Error in Marshalling Slice of Struct type -> affected/package: json
Aug 2, 2023
Prakhar-FF13
changed the title
Error in Marshalling Slice of Struct type -> affected/package: json
json: Error in Marshalling Slice of Struct type -> affected/package: json
Aug 2, 2023
Prakhar-FF13
changed the title
json: Error in Marshalling Slice of Struct type -> affected/package: json
encoding/json: Error in Marshalling Slice of Struct type -> affected/package: json
Aug 2, 2023
Unlike many projects, the Go project does not use GitHub Issues for general discussion or asking questions. GitHub Issues are used for tracking bugs and proposals only.
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
I am on the latest version
What operating system and processor architecture are you using (
go env
)?go env
GO111MODULE="" GOARCH="arm64" GOBIN="" GOCACHE="/Users/prakharkumar/Library/Caches/go-build" GOENV="/Users/prakharkumar/Library/Application Support/go/env" GOEXE="" GOEXPERIMENT="" GOFLAGS="" GOHOSTARCH="arm64" GOHOSTOS="darwin" GOINSECURE="" GOMODCACHE="/Users/prakharkumar/go/pkg/mod" GONOPROXY="" GONOSUMDB="" GOOS="darwin" GOPATH="/Users/prakharkumar/go" GOPRIVATE="" GOPROXY="https://proxy.golang.org,direct" GOROOT="/opt/homebrew/Cellar/go/1.20.5/libexec" GOSUMDB="sum.golang.org" GOTMPDIR="" GOTOOLDIR="/opt/homebrew/Cellar/go/1.20.5/libexec/pkg/tool/darwin_arm64" GOVCS="" GOVERSION="go1.20.5" GCCGO="gccgo" AR="ar" CC="cc" CXX="c++" CGO_ENABLED="1" GOMOD="/dev/null" GOWORK="" CGO_CFLAGS="-O2 -g" CGO_CPPFLAGS="" CGO_CXXFLAGS="-O2 -g" CGO_FFLAGS="-O2 -g" CGO_LDFLAGS="-O2 -g" PKG_CONFIG="pkg-config" GOGCCFLAGS="-fPIC -arch arm64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/s6/97rzy6yd76d5rd9fldl8x4dc0000gn/T/go-build4001747071=/tmp/go-build -gno-record-gcc-switches -fno-common"What did you do?
Tried to Marshal a struct type array
type CM struct
{
kind string,
payload []byte,
}
x is an array of CM i.e []CM.
json.Marshal(x) ---> this gives wrong output, but no error is returned.
What did you expect to see?
Marshalled output - example:
[{abc:"some"}, {abc:"thing"}]
What did you see instead?
[{}]
The text was updated successfully, but these errors were encountered: