Skip to content

"go vet" needs a 'ignore this' mechanism #18432

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
brianolson opened this issue Dec 26, 2016 · 2 comments
Closed

"go vet" needs a 'ignore this' mechanism #18432

brianolson opened this issue Dec 26, 2016 · 2 comments

Comments

@brianolson
Copy link

What version of Go are you using (go version)?

go version go1.7.4 darwin/amd64

What operating system and processor architecture are you using (go env)?

GOARCH="amd64"
GOBIN=""
GOEXE=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOOS="darwin"
GOPATH="/Users/bolson/psrc/gopath"
GORACE=""
GOROOT="/usr/local/go"
GOTOOLDIR="/usr/local/go/pkg/tool/darwin_amd64"
CC="clang"
GOGCCFLAGS="-fPIC -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/rh/3lrlb3dx2gj8s_5yyxb2vsyc0000gn/T/go-build257955075=/tmp/go-build -gno-record-gcc-switches -fno-common"
CXX="clang++"
CGO_ENABLED="1"

What did you do?

a.go:
`
package main

import "fmt"
import "os"

func main() {
out := os.Stdout
i := 1
fmt.Fprint(out, "I am 100% sure what I'm doing here\n") // go vet ignore -- wouldn't it be nice if there were a directive to silence the go vet warning here?
}
`

What did you expect to see?

go vet should be able to have no complaint about this file

What did you see instead?

$ go vet
a.go:9: possible formatting directive in Fprint call
exit status 1

If this feature exists and is undocumented, it needs to be documented
https://golang.org/cmd/vet/
See also prior issue of excessive warnings like this
#6407

@ALTree
Copy link
Member

ALTree commented Dec 26, 2016

This was discussed in #17058. Note that the introduction of a new directive/magic comment to be used to silence vet warnings was unanimously rejected.

@robpike
Copy link
Contributor

robpike commented Dec 26, 2016

Duplicate of the comment stream in #17058

@robpike robpike closed this as completed Dec 26, 2016
@golang golang locked and limited conversation to collaborators Dec 26, 2017
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