The latest version of go vet (go 1.4.1 with latest tools repo commit golang/tools@913f41fc5f1b7afd8f7c66c011c1ad368fa23fb8) is incorrectly reporting malformed struct tags when one of the tag values contains spaces.
Here is a minimal set of steps to reproduce the issue:
$ mkdir $GOPATH/src/govetissue
$ cd $GOPATH/src/govetissue
$ cat > main.go <<END
package main
type foo struct {
A int \`short:"V" description:"Test description"\`
}
func main() {
}
END
$ go vet
Output:
/home/davec/mygo/src/govetissue/main.go:4: struct field tag short:"V" description:"Test description" not compatible with reflect.StructTag.Get: bad syntax for struct tag value
exit status 1
Removing the space inside the quoted value for the description (i.e. TestDescription) does not report the error, but clearly that is not the intended behavior.
I've reproduced this issue with Windows, Linux, and OpenBSD.
The latest version of go vet (go 1.4.1 with latest tools repo commit golang/tools@913f41fc5f1b7afd8f7c66c011c1ad368fa23fb8) is incorrectly reporting malformed struct tags when one of the tag values contains spaces.
Here is a minimal set of steps to reproduce the issue:
Output:
Removing the space inside the quoted value for the description (i.e.
TestDescription
) does not report the error, but clearly that is not the intended behavior.I've reproduced this issue with Windows, Linux, and OpenBSD.