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: (or maybe cmd/go or maybe go/types) doesn't handle tests in separate package well #6389

Closed
robpike opened this issue Sep 15, 2013 · 5 comments

Comments

@robpike
Copy link
Contributor

robpike commented Sep 15, 2013

$ cd fmt
$ go vet -x
/Users/r/go/pkg/tool/darwin_amd64/vet doc.go export_test.go fmt_test.go format.go
print.go scan.go scan_test.go stringer_test.go
$ # Add the -v flag
$ /Users/r/go/pkg/tool/darwin_amd64/vet -v doc.go export_test.go fmt_test.go format.go
print.go scan.go scan_test.go stringer_test.go

see lots of incorrect errors because:

vet: fmt_test.go:5:1: package fmt_test; expected fmt

$ # Do this instead, breaking the arguments into two runs of distinct packages.
$ # The warnings here are legitimate.
$
$ /Users/r/go/pkg/tool/darwin_amd64/vet -v doc.go export_test.go format.go print.go
scan.go
Checking file doc.go
Checking file export_test.go
Checking file format.go
Checking file print.go
print.go:229: can't check non-constant format in call to Fprintf
print.go:244: can't check non-constant format in call to Sprintf
Checking file scan.go
$ /Users/r/go/pkg/tool/darwin_amd64/vet -v fmt_test.go scan_test.go stringer_test.go
vet: fmt_test.go:957:6: undeclared name: IsSpace
Checking file fmt_test.go  ##### This one is problematic; it's in export_test.go in
package fmt.
fmt_test.go:522: can't check non-constant format in call to Sprintf
fmt_test.go:596: can't check non-constant format in call to Sprintf
fmt_test.go:724: can't check non-constant format in call to Sprintf
fmt_test.go:748: can't check non-constant format in call to Sprintf
fmt_test.go:859: can't check non-constant format in call to Sprintf
fmt_test.go:912: can't check non-constant format in call to Sprintf
fmt_test.go:968: arg nil for printf verb %s of wrong type: untyped nil
Checking file scan_test.go
Checking file stringer_test.go
$

The question is, who should do this breakdown?
@rsc
Copy link
Contributor

rsc commented Nov 27, 2013

Comment 1:

Labels changed: added go1.3maybe.

@rsc
Copy link
Contributor

rsc commented Dec 4, 2013

Comment 2:

Labels changed: added release-none, removed go1.3maybe.

@rsc
Copy link
Contributor

rsc commented Dec 4, 2013

Comment 3:

Labels changed: added repo-tools.

@jscrockett01
Copy link

Comment 4:

FYI this issue was fixed by revision 25ea6fb44f62 but was not linked in the CL.

@rsc
Copy link
Contributor

rsc commented Nov 13, 2014

Comment 5:

Status changed to Duplicate.

Merged into issue #8511.

This issue was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants