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
In certain situations when a struct has a member of type interface and is initialised with a value it will still be nil. I was able to create a sample in Go Playground to reproduce it:
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
Yes
What operating system and processor architecture are you using (
go env
)?go env
GOARCH="amd64" GOBIN="" GOCACHE="removed" GOEXE="" GOFLAGS="" GOHOSTARCH="amd64" GOHOSTOS="darwin" GOOS="darwin" GOPATH="removed" GOPROXY="" GORACE="" GOROOT="/usr/local/go" GOTMPDIR="" GOTOOLDIR="/usr/local/go/pkg/tool/darwin_amd64" GCCGO="gccgo" CC="clang" CXX="clang++" CGO_ENABLED="1" GOMOD="" CGO_CFLAGS="-g -O2" CGO_CPPFLAGS="" CGO_CXXFLAGS="-g -O2" CGO_FFLAGS="-g -O2" CGO_LDFLAGS="-g -O2" PKG_CONFIG="pkg-config" GOGCCFLAGS="-fPIC -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/9w/jk857_nn2z99k31qsg9pbwjr0000gn/T/go-build429491925=/tmp/go-build -gno-record-gcc-switches -fno-common"What did you do?
In certain situations when a struct has a member of type interface and is initialised with a value it will still be nil. I was able to create a sample in Go Playground to reproduce it:
https://play.golang.org/p/EuFQjhSybmF
Struct member "Height" is nil in that example when it should be "Height:{V:0}"
Just by playing a bit with the code you can make it work:
What did you expect to see?
{Name:some prop Title: Height:{V:0}}
What did you see instead?
{Name:some prop Title: Height:}
The text was updated successfully, but these errors were encountered: