Skip to content

cmd/vet: false positive for build flag when it appears in a string of source code #12269

@srinathh

Description

@srinathh

I ran into a likely false positive from go vet when writing a program that auto-generates code.

This program generates a warning +build comment must appear before package clause and be followed by a blank line

This equivalent program without the // autogenerated by... comment in the first line doesn't

In either case, i don't think go vet should be vetting contents of the string,

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions