go/packages: remove spurious print

Also fix a test name.

Fixes golang/go#30994

Change-Id: Ib37359254206ecf47b0ac23098c57da1e69944a1
Reviewed-on: https://go-review.googlesource.com/c/tools/+/168939
Run-TryBot: Michael Matloob <matloob@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
This commit is contained in:
Michael Matloob 2019-03-22 16:28:41 -04:00
parent 3a76a6439c
commit c1a832b0ad
2 changed files with 1 additions and 2 deletions

View File

@ -761,7 +761,6 @@ func invokeGo(cfg *Config, args ...string) (*bytes.Buffer, error) {
if len(stderr.String()) > 0 && strings.Contains(stderr.String(), "named files must be .go files") { if len(stderr.String()) > 0 && strings.Contains(stderr.String(), "named files must be .go files") {
output := fmt.Sprintf(`{"ImportPath": "","Incomplete": true,"Error": {"Pos": "","Err": %s}}`, output := fmt.Sprintf(`{"ImportPath": "","Incomplete": true,"Error": {"Pos": "","Err": %s}}`,
strconv.Quote(strings.Trim(stderr.String(), "\n"))) strconv.Quote(strings.Trim(stderr.String(), "\n")))
fmt.Println(output)
return bytes.NewBufferString(output), nil return bytes.NewBufferString(output), nil
} }

View File

@ -313,7 +313,7 @@ func TestLoadAbsolutePath(t *testing.T) {
} }
} }
func TestReturnErrorWhenUsingNoneGoFiles(t *testing.T) { func TestReturnErrorWhenUsingNonGoFiles(t *testing.T) {
exported := packagestest.Export(t, packagestest.GOPATH, []packagestest.Module{{ exported := packagestest.Export(t, packagestest.GOPATH, []packagestest.Module{{
Name: "golang.org/gopatha", Name: "golang.org/gopatha",
Files: map[string]interface{}{ Files: map[string]interface{}{