-
Notifications
You must be signed in to change notification settings - Fork 18k
New issue
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
cmd/vet: Vet incorrectly reports composite literal uses unkeyed fields on user defined types #6820
Labels
Comments
This behaviour is intentional. Using field keys for a struct composite literal for a struct type defined in a different package means that your composite literal is immune to backward compatible changes in the imported package. See the note on "struct literals" in http://golang.org/doc/go1compat . For a type defined within the same package there are no concerns about backward compatible changes, so vet doesn't warn about them. Status changed to WorkingAsIntended. |
alban
added a commit
to alban/rkt
that referenced
this issue
Jul 6, 2015
Symptoms: coreos/rkt/store/store_test.go:286: types.Labels composite literal uses unkeyed fields See rationale: golang/go#6820
alban
added a commit
to alban/rkt
that referenced
this issue
Jul 6, 2015
Symptoms: coreos/rkt/store/store_test.go:286: types.Labels composite literal uses unkeyed fields See rationale: golang/go#6820
alban
added a commit
to alban/rkt
that referenced
this issue
Jul 6, 2015
Symptoms: coreos/rkt/store/store_test.go:286: types.Labels composite literal uses unkeyed fields See rationale: golang/go#6820
alban
added a commit
to alban/rkt
that referenced
this issue
Jul 6, 2015
go vet works fine on newer versions (1.4.2) but it does not work on go 1.4 installed on Semaphore. Symptoms: coreos/rkt/store/store_test.go:286: types.Labels composite literal uses unkeyed fields See also: golang/go#6820
alban
added a commit
to endocode/rkt
that referenced
this issue
Jul 6, 2015
go vet works fine on newer versions (1.4.2) but it does not work on go 1.4 installed on Semaphore. Symptoms: coreos/rkt/store/store_test.go:286: types.Labels composite literal uses unkeyed fields See also: golang/go#6820
alban
added a commit
to endocode/rkt
that referenced
this issue
Jul 8, 2015
go vet works fine on newer versions (1.4.2) but it does not work on go 1.4 installed on Semaphore. Symptoms: coreos/rkt/store/store_test.go:286: types.Labels composite literal uses unkeyed fields See also: golang/go#6820
alban
added a commit
to endocode/rkt
that referenced
this issue
Jul 8, 2015
go vet works fine on newer versions (1.4.2) but it does not work on go 1.4 installed on Semaphore. Symptoms: coreos/rkt/store/store_test.go:286: types.Labels composite literal uses unkeyed fields See also: golang/go#6820
alban
added a commit
to endocode/rkt
that referenced
this issue
Jul 9, 2015
go vet works fine on newer versions (1.4.2) but it does not work on go 1.4 installed on Semaphore. Symptoms: coreos/rkt/store/store_test.go:286: types.Labels composite literal uses unkeyed fields See also: golang/go#6820
alban
added a commit
to endocode/rkt
that referenced
this issue
Jul 9, 2015
go vet works fine on newer versions (1.4.2) but it does not work on go 1.4 installed on Semaphore. Symptoms: coreos/rkt/store/store_test.go:286: types.Labels composite literal uses unkeyed fields See also: golang/go#6820
alban
added a commit
to endocode/rkt
that referenced
this issue
Jul 9, 2015
go vet works fine on newer versions (1.4.2) but it does not work on go 1.4 installed on Semaphore. Symptoms: coreos/rkt/store/store_test.go:286: types.Labels composite literal uses unkeyed fields See also: golang/go#6820
alban
added a commit
to endocode/rkt
that referenced
this issue
Jul 10, 2015
go vet works fine on newer versions (1.4.2) but it does not work on go 1.4 installed on Semaphore. Symptoms: coreos/rkt/store/store_test.go:286: types.Labels composite literal uses unkeyed fields See also: golang/go#6820
jonboulle
added a commit
to jonboulle/rkt
that referenced
this issue
Jul 29, 2015
`go vet` does not track types across packages and so assumes types.Labels is a struct rather than a container; consequently, it complains about unkeyed fields in store_test.go To work around this, use a []types.Label and have go automatically convert the type instead. Re-enables go vet checking on Semaphore. golang/go#6820
This issue was closed.
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
The text was updated successfully, but these errors were encountered: