cmd/vet: "go tool vet" gives error "invalid command: want .cfg file" #28869
Comments
@alandonovan has been refactoring |
I am getting this error as well. vet: invalid command: want .cfg file (this reduced version of vet is intended to be run only by the 'go vet' command) go version devel +339e5ff189 Tue Nov 20 20:56:13 2018 +0000 linux/amd64 |
This has broken the workflow under emacs's flycheck calling go vet. |
@alandonovan @matloob Can you give some background on this? The basic issue is that |
Apologies for the slow response--I was hoping to come up with a bright idea, but have had none. My impression throughout the vet redesign, based on discussions with Russ, was that 'go tool vet' was not something we intended to support; furthermore vet analyzers have been increasingly reliant on the well-typedness of their inputs, so the old vet could crash if run directly. But as always, reality is more complicated: supported or not, people were using it, and it was a lot faster than 'go vet', making it attractive for uses such as flycheck, and cmd/vet/all. The choices are:
None of the options are good, but I know which one I prefer. I'm sorry I didn't anticipate this problem. |
I am somewhat confused. @alandonovan, I know that you have refactored go vet. Where can I read about this from the user's point of view? I could not find any documentation explain what happened in details. Where can I learn the difference between |
@ysmolsky At the moment on tip Is it possible for FlyCheck to use |
@ianlancetaylor I have created a ticket flycheck/flycheck#1523. It is possible to use |
@ysmolsky You have probably seen this doc https://docs.google.com/document/d/1-azPLXaLgTCKeKDNg0HVMq2ovMlD-e7n1ZHzZVzOlJk which describes the changes from the point of view of analysis tool writers. I have not written a doc from the vet user's point of view because I did not anticipate that there would be any significant changes, although of course I underestimated the significance of removing support for directly executing 'go tool vet'. |
@alandonovan thank you for the link. I have found temporary solution by switching flycheck to |
@ysmolsky cmd/vet should still run those analyzers that identify themselves as robust in the face of syntax or type errors, but they are a minority. Perhaps more of them could be made robust with fairly marginal effort. It wouldn't require a new analysis driver. |
Fixes #186 Additionally, updates TravisCI to test with Go v1.9.x -> tip, and and allow tip failures (related: golang/go#28869)
Change https://golang.org/cl/152217 mentions this issue: |
Previously running "go tool vet" said vet: invalid command: want .cfg file (this reduced version of vet is intended to be run only by the 'go vet' command) With this change it says: vet: invoking "go tool vet" directly is unsupported; use "go vet" Updates golang/go#28869 Change-Id: I603ab2f75bb52d860e5cd7466e89d051dfbf3f08 Reviewed-on: https://go-review.googlesource.com/c/152217 Run-TryBot: Ian Lance Taylor <iant@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Alan Donovan <adonovan@google.com>
Change https://golang.org/cl/152257 mentions this issue: |
The error message now says
Our current plan is to declare that |
Change https://golang.org/cl/152161 mentions this issue: |
Updates #28869 Change-Id: Ie152bf959af2e9cd32b1ccc031e8208e64fbe3ce Reviewed-on: https://go-review.googlesource.com/c/152161 Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org> Reviewed-by: Alan Donovan <adonovan@google.com>
@ianlancetaylor, sounds like a plan. If that is decided, this ticket can be closed as no more work is anticipated here. Other tools ought to be fixed. |
As far as I know everything in the Go project is fixed and there is nothing to do here. We may need to revisit this based on reaction to the beta, but closing for now. |
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
I see this issue on tip
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
What did you expect to see?
I expected go tool vet to run successfully.
What did you see instead?
I found out about this error because I kept getting it in my emacs messages during development.
The error I got came from flycheck (a well known syntax checker for emacs supporting many many languages and modes). On further investigation into the sub-module of flycheck, I saw that they were executing "go tool vet" and showing me this error on each save.
The text was updated successfully, but these errors were encountered: