cmd/go, flag: make undefined flag msg less ambiguous. Fixes #36364 #37944
Add this suggestion to a batch that can be applied as a single commit. This suggestion is invalid because no changes were made to the code. Suggestions cannot be applied while the pull request is closed. Suggestions cannot be applied while viewing a subset of changes. Only one suggestion per line can be applied in a batch. Add this suggestion to a batch that can be applied as a single commit. Applying suggestions on deleted lines is not supported. You must change the existing code in this line in order to create a valid suggestion. Outdated suggestions cannot be applied. This suggestion has been applied or marked resolved. Suggestions cannot be applied from pending reviews. Suggestions cannot be applied on multi-line comments. Suggestions cannot be applied while the pull request is queued to merge. Suggestion cannot be applied right now. Please check back later.
This fix tries to improve the error message from an undefined flag as discussed in issue #36364 Changing this error message unfortunately has a high impact on 3rd party tools and editors that monitor the go command stderr output for the error message that is changed here. Any tool that imports the flag package will be affected. Vscode-go plugin and likely other editors and tools will be affected. I have also completed the matching changes neeeded for golang/tools, golang/dep, golang/gofrontend and microsoft/vscode-go. I'll link them in here after I create the corresponding PR's for them all
golang/gofrontend#2
golang/dep#2238
golang/tools#216
microsoft/vscode-go#3113