Skip to content

cmd/vet: "possible malformed +build comment" check too strict #30252

Description

@eliasnaur

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

$ go version
go version devel +ffd096db2b Wed Feb 13 05:35:45 2019 +0000 linux/amd64

Does this issue reproduce with the latest release?

Yes

What did you do?

I have a go generate line that prepends a +build comment to a C file:

//go:generate sed -i "1s;^;// +build linux,!android\\n\\n;" wayland_xdg_shell.c

What did you expect to see?

No warning from go vet or go test.

What did you see instead?

Running go vet or go test on the package results in:

os/os_wayland.go:14:1: possible malformed +build comment

I admit this is a special case.

Metadata

Metadata

Assignees

No one assigned

    Labels

    AnalysisIssues related to static analysis (vet, x/tools/go/analysis)NeedsInvestigationSomeone must examine and confirm this is a valid issue and not a duplicate of an existing one.

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions