Skip to content
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: setting composites flag false doesn't do anything #7422

gopherbot opened this issue Feb 27, 2014 · 3 comments


None yet
3 participants
Copy link

commented Feb 27, 2014


Create the test files like this (shell)

mkdir vet_bug
cd vet_bug
export GOPATH=`pwd`
mkdir src
cd src
mkdir a
cat <<EOF > a/a.go
package a

type Tuple []string
cat <<EOF > main.go
package t

import "a"

var x = a.Tuple{"a", "b", "c"}
go build ./...
go tool vet -composites=false ./...

This creates a directory structure like this with GOPATH set

└── src
    ├── a
    │   └── a.go
    └── main.go

What is the expected output?

What do you see instead?
src/main.go:5: a.Tuple composite literal uses unkeyed fields

Which operating system are you using?
mac os x 10.9

Which version are you using?  (run 'go version' or 'gccgo --version')
go version go1.2 darwin/amd64

This comment has been minimized.

Copy link

commented Feb 27, 2014

Comment 1 by

Language in the documentation suggests that I can disable the associated checks (i.e.
composites) by passing in the associated flag, but in fact it does the opposite, where
by passing in the flag, it enables that particular set of checks.  
I was able to find a workaround in the meantime, by just passing in the set of flags for
the tests I want to run, but it does look kind of ugly.

This comment has been minimized.

Copy link

commented Mar 3, 2014

Comment 2:

Owner changed to @robpike.

Status changed to Thinking.


This comment has been minimized.

Copy link

commented Mar 7, 2014

Comment 3:

This issue was closed by revision golang/tools@6bd3206.

Status changed to Fixed.

@gopherbot gopherbot added the fixed label Mar 7, 2014

@golang golang locked and limited conversation to collaborators Jun 25, 2016

This issue was closed.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
You can’t perform that action at this time.