Repository: go
Issue: cmd/go: poor error message for nonmatching go-import tags
Labels: NeedsFix,GoCommand

### What version of Go are you using (`go version`)?

<pre>
$ go version
go version devel +1e6ad65b43 Tue Sep 8 18:52:38 2020 +0000 darwin/amd64
</pre>

### Does this issue reproduce with the latest release?

Yes.

### What operating system and processor architecture are you using (`go env`)?

Catalina, MacOS, amd64.

### What did you do?

I typed by mistake the wrong import string; I forgot the cmd, and got 1472 characters of this:

<pre>
% go get robpike.io/tab
package robpike.io/tab: unrecognized import path "robpike.io/tab": parse https://robpike.io/tab?go-get=1: no go-import meta tags (meta tag robpike.io/cmd/doc did not match import path robpike.io/tab, meta tag robpike.io/ivy did not match import path robpike.io/tab, meta tag robpike.io/cmd/freq did not match import path robpike.io/tab, meta tag robpike.io/cmd/hira did not match import path robpike.io/tab, meta tag robpike.io/cmd/kana did not match import path robpike.io/tab, meta tag robpike.io/cmd/kata did not match import path robpike.io/tab, meta tag robpike.io/cmd/now did not match import path robpike.io/tab, meta tag robpike.io/cmd/strings did not match import path robpike.io/tab, meta tag robpike.io/cmd/translate did not match import path robpike.io/tab, meta tag robpike.io/cmd/typo did not match import path robpike.io/tab, meta tag robpike.io/cmd/unicode did not match import path robpike.io/tab, meta tag robpike.io/filter did not match import path robpike.io/tab, meta tag robpike.io/toy did not match import path robpike.io/tab, meta tag robpike.io/nihongo did not match import path robpike.io/tab, meta tag robpike.io/cmd/scrub did not match import path robpike.io/tab, meta tag robpike.io/cmd/tab did not match import path robpike.io/tab, meta tag robpike.io/cmd/sid did not match import path robpike.io/tab, meta tag robpike.io/cmd/script did not match import path robpike.io/tab, meta tag robpike.io/lisp did not match import path robpike.io/tab)
% go get robpike.io/cmd/tab
%
</pre>

Reflowed using fmt, that's:
<pre>
package robpike.io/tab: unrecognized import path "robpike.io/tab":
parse https://robpike.io/tab?go-get=1: no go-import meta tags (meta
tag robpike.io/cmd/doc did not match import path robpike.io/tab,
meta tag robpike.io/ivy did not match import path robpike.io/tab,
meta tag robpike.io/cmd/freq did not match import path robpike.io/tab,
meta tag robpike.io/cmd/hira did not match import path robpike.io/tab,
meta tag robpike.io/cmd/kana did not match import path robpike.io/tab,
meta tag robpike.io/cmd/kata did not match import path robpike.io/tab,
meta tag robpike.io/cmd/now did not match import path robpike.io/tab,
meta tag robpike.io/cmd/strings did not match import path robpike.io/tab,
meta tag robpike.io/cmd/translate did not match import path
robpike.io/tab, meta tag robpike.io/cmd/typo did not match import
path robpike.io/tab, meta tag robpike.io/cmd/unicode did not match
import path robpike.io/tab, meta tag robpike.io/filter did not match
import path robpike.io/tab, meta tag robpike.io/toy did not match
import path robpike.io/tab, meta tag robpike.io/nihongo did not
match import path robpike.io/tab, meta tag robpike.io/cmd/scrub did
not match import path robpike.io/tab, meta tag robpike.io/cmd/tab
did not match import path robpike.io/tab, meta tag robpike.io/cmd/sid
did not match import path robpike.io/tab, meta tag robpike.io/cmd/script
did not match import path robpike.io/tab, meta tag robpike.io/lisp
did not match import path robpike.io/tab)
</pre>


### What did you expect to see?

A shorter, better-formatted error message. This one doesn't even have newlines.

<pre>
% go get robpike.io/tab
package robpike.io/tab: unrecognized import path "robpike.io/tab": parse https://robpike.io/tab?go-get=1: no go-import m
</pre>

### What did you see instead?

A long, poorly-formatted error mess.