We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
go version go1.21.4 linux/amd64
go env
GO111MODULE='' GOARCH='amd64' GOBIN='' GOCACHE='/home/user/.cache/go-build' GOENV='/home/user/.config/go/env' GOEXE='' GOEXPERIMENT='' GOFLAGS='' GOHOSTARCH='amd64' GOHOSTOS='linux' GOINSECURE='' GOMODCACHE='/home/user/go/pkg/mod' GONOPROXY='' GONOSUMDB='' GOOS='linux' GOPATH='/home/user/go' GOPRIVATE='' GOPROXY='https://proxy.golang.org,direct' GOROOT='/usr/local/go' GOSUMDB='sum.golang.org' GOTMPDIR='' GOTOOLCHAIN='auto' GOTOOLDIR='/usr/local/go/pkg/tool/linux_amd64' GOVCS='' GOVERSION='go1.21.4' GCCGO='gccgo' GOAMD64='v1' AR='ar' CC='gcc' CXX='g++' 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 -m64 -pthread -Wl,--no-gc-sections -fmessage-length=0 -ffile-prefix-map=/tmp/go-build4185726577=/tmp/go-build -gno-record-gcc-switches'
When instantiating
type A struct { *B }
like this
A{b} // b is of type *B
The warning composite literal uses unkeyed fields appears.
composite literal uses unkeyed fields
Since there is no ambiguity (only one member) I expect no warning. There is discussion about this issue here: https://stackoverflow.com/q/36273920
The text was updated successfully, but these errors were encountered:
The check is to ensure structs from different packages can evolve safely. See also #43864
Sorry, something went wrong.
No branches or pull requests
Uh oh!
There was an error while loading. Please reload this page.
Go version
go version go1.21.4 linux/amd64
Output of
go env
in your module/workspace:What did you do?
When instantiating
like this
What did you see happen?
The warning
composite literal uses unkeyed fields
appears.What did you expect to see?
Since there is no ambiguity (only one member) I expect no warning.
There is discussion about this issue here: https://stackoverflow.com/q/36273920
The text was updated successfully, but these errors were encountered: