<p dir="auto"><code class="notranslate">main.go</code>:</p>
<div class="highlight highlight-source-go notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="package main
const foo = `
//+build ignore
`"><pre class="notranslate"><span class="pl-k">package</span> main
<span class="pl-k">const</span> <span class="pl-s1">foo</span> <span class="pl-c1">=</span> <span class="pl-s">`</span>
<span class="pl-s">//+build ignore</span>
<span class="pl-s">`</span></pre></div>
<p dir="auto">Running <code class="notranslate">vet</code> produces:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="main.go:3: +build comment must appear before package clause and be followed by a blank line"><pre class="notranslate"><code class="notranslate">main.go:3: +build comment must appear before package clause and be followed by a blank line
</code></pre></div>
<p dir="auto">This also contributes to noise in the vet output for core, e.g.</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="./src/crypto/x509/root_darwin_arm_gen.go:181: +build comment must appear before package clause and be followed by a blank line
./src/crypto/x509/root_darwin_arm_gen.go:182: +build comment must appear before package clause and be followed by a blank line
./src/crypto/x509/root_darwin_arm_gen.go:183: +build comment must appear before package clause and be followed by a blank line"><pre class="notranslate"><code class="notranslate">./src/crypto/x509/root_darwin_arm_gen.go:181: +build comment must appear before package clause and be followed by a blank line
./src/crypto/x509/root_darwin_arm_gen.go:182: +build comment must appear before package clause and be followed by a blank line
./src/crypto/x509/root_darwin_arm_gen.go:183: +build comment must appear before package clause and be followed by a blank line
</code></pre></div>
<p dir="auto">I ran into a likely false positive from <code class="notranslate">go vet</code> when writing a program that auto-generates  code.</p>
<p dir="auto"><a href="http://play.golang.org/p/kJgX_8nTCa" rel="nofollow">This program</a> generates a warning <code class="notranslate">+build comment must appear before package clause and be followed by a blank line</code></p>
<p dir="auto"><a href="http://play.golang.org/p/A-B8EklrHv" rel="nofollow">This equivalent program</a> without the <code class="notranslate">// autogenerated by...</code> comment in the first line doesn't</p>
<p dir="auto">In either case, i don't think <code class="notranslate">go vet</code> should be vetting contents of the string,</p>