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

Closed
gopherbot opened this issue Feb 27, 2014 · 3 comments
Closed

cmd/vet: setting composites flag false doesn't do anything #7422

gopherbot opened this issue Feb 27, 2014 · 3 comments
Assignees

Comments

@gopherbot
Copy link

@gopherbot gopherbot commented Feb 27, 2014

by herbert@clypd.com:

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
EOF
cat <<EOF > main.go
package t

import "a"

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


This creates a directory structure like this with GOPATH set

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

What is the expected output?
nothing

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
@gopherbot

This comment has been minimized.

Copy link
Author

@gopherbot gopherbot commented Feb 27, 2014

Comment 1 by herbert@clypd.com:

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.
@rsc

This comment has been minimized.

Copy link
Contributor

@rsc rsc commented Mar 3, 2014

Comment 2:

Owner changed to @robpike.

Status changed to Thinking.

@robpike

This comment has been minimized.

Copy link
Contributor

@robpike robpike 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.
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants
You can’t perform that action at this time.