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/go: go vet should tell cmd/vet the names of .s files #27665

Closed
alandonovan opened this issue Sep 13, 2018 · 1 comment

Comments

Projects
None yet
4 participants
@alandonovan
Copy link
Contributor

commented Sep 13, 2018

$ go version
go version devel +c5d38b896d Thu Aug 23 06:10:48 2018 +0000 linux/amd64

$ go list -f {{.SFiles}} math/big
[arith_amd64.s]

$ go vet -x math/big
...
cat >$WORK/b001/vet.cfg << 'EOF' # internal
{
        "Dir": "/home/adonovan/go/src/math/big",
        "ImportPath": "math/big",
        "GoFiles": [
                "/home/adonovan/go/src/math/big/accuracy_string.go",
                ...,
        ],
        ...,
}
EOF
...

Some vet checks, such as asmdecl and buildtag, apply equally to the Go files and non-Go files of a package. However, the .cfg file that go vet passes to cmd/vet does not mention them, so these checks are incomplete or ineffective.

The .cfg file should contain a field NonGoFiles that lists the package source files written in assembly, C, Fortran, and all the other benighted languages.

@andybons andybons added the NeedsFix label Sep 25, 2018

@andybons andybons added this to the Unplanned milestone Sep 25, 2018

@gopherbot

This comment has been minimized.

Copy link

commented Nov 12, 2018

Change https://golang.org/cl/148904 mentions this issue: cmd/go: vet: pass non-.go files to vet tool

@gopherbot gopherbot closed this in e787b13 Nov 13, 2018

gopherbot pushed a commit to golang/tools that referenced this issue Nov 15, 2018

go/analysis/internal/unitchecker: three fixes
- add a no-op -tags flag for legacy compatibility.
  Tags processing is done by go vet, but it passes the flag on.
  Exercised by cmd/go TestGoVetWithTags.

- rename OtherFiles to NonGoFiles in the JSON *.cfg file, to match
  the name actually used for this field (see github.com/golang/go/issues/27665).
  We really need to publish the types for this protocol.
  Exercised by cmd/go TestScript/vet_asm.

- suppress diagnostics in cfg.VetxOnly mode.
  Exercised by cmd/go TestTestVet.

Change-Id: I63259f1bd01531d110362e38190a220389b2ec4b
Reviewed-on: https://go-review.googlesource.com/c/149608
Run-TryBot: Alan Donovan <adonovan@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Michael Matloob <matloob@golang.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.