<p dir="auto">Go Version: go version go1.4 windows/amd64</p>
<p dir="auto">I was editing a file with Windows line endings, and I was unable to make it work.</p>
<p dir="auto">It seems like the \r character is added as part of the last parameter, which makes commands fail.</p>
<p dir="auto">It should be re-producible with all files using \r\n as line endings, but here is the actual command I used.</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="//go:generate ffjson $GOFILE"><pre class="notranslate"><code class="notranslate">//go:generate ffjson $GOFILE
</code></pre></div>
<p dir="auto">Using quoting also makes it fail.</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="//go:generate ffjson &quot;file.go&quot;"><pre class="notranslate"><code class="notranslate">//go:generate ffjson "file.go"
</code></pre></div>
<p dir="auto">Will exit with "expect space after quoted argument", because the next character check in the following code fails:</p>
<div class="highlight highlight-source-go notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="                    // Check the next character is space or end of line.
                    if len(line) &gt; 0 &amp;&amp; line[0] != ' ' &amp;&amp; line[0] != '\t' {
                        g.errorf(&quot;expect space after quoted argument&quot;)
                    }"><pre class="notranslate">                    <span class="pl-c">// Check the next character is space or end of line.</span>
                    <span class="pl-k">if</span> <span class="pl-en">len</span>(<span class="pl-s1">line</span>) <span class="pl-c1">&gt;</span> <span class="pl-c1">0</span> <span class="pl-c1">&amp;&amp;</span> <span class="pl-s1">line</span>[<span class="pl-c1">0</span>] <span class="pl-c1">!=</span> <span class="pl-s">' '</span> <span class="pl-c1">&amp;&amp;</span> <span class="pl-s1">line</span>[<span class="pl-c1">0</span>] <span class="pl-c1">!=</span> <span class="pl-s">'\t'</span> {
                        <span class="pl-s1">g</span>.<span class="pl-en">errorf</span>(<span class="pl-s">"expect space after quoted argument"</span>)
                    }</pre></div>
<p dir="auto">line[0] is '\r'</p>
<p dir="auto">Just tested the new "go generate" command. I'm using a windows machine and so my line endings are \r\n and not just \n.<br>
so if I put "//go:generate dosomething" in my source code and run "go generate" it executed "dosomething\r" which can not be found. (Tested with go1.4.windows-amd64 release)<br>
Sorry for submitting if this is expected behavior...</p>