Skip to content

cmd/go: go vet should tell cmd/vet the names of .s files #27665

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

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

cmd/go: go vet should tell cmd/vet the names of .s files #27665

alandonovan opened this issue Sep 13, 2018 · 1 comment
Labels
FrozenDueToAge NeedsFix The path to resolution is known, but the work has not been done.
Milestone

Comments

@alandonovan
Copy link
Contributor

alandonovan 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 The path to resolution is known, but the work has not been done. label Sep 25, 2018
@andybons andybons added this to the Unplanned milestone Sep 25, 2018
@gopherbot
Copy link
Contributor

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

gopherbot pushed a commit to golang/tools that referenced this issue Nov 15, 2018
- 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 <[email protected]>
TryBot-Result: Gobot Gobot <[email protected]>
Reviewed-by: Michael Matloob <[email protected]>
@golang golang locked and limited conversation to collaborators Nov 13, 2019
@rsc rsc unassigned bcmills Jun 23, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge NeedsFix The path to resolution is known, but the work has not been done.
Projects
None yet
Development

No branches or pull requests

4 participants