mirror of
https://github.com/golang/go
synced 2024-11-05 15:56:12 -07:00
c5cec6710e
Over time we have accumulated a disturbing number of ways to run the Go command, each of which supported slightly different features and workarounds. Combine all of them. This unavoidably introduces some changes in debug logging behavior; I think we should try to fix them incrementally and consistently. Updates golang/go#37368. Change-Id: I664ca8685bf247a226be3cb807789c2fcddf233d Reviewed-on: https://go-review.googlesource.com/c/tools/+/220737 Run-TryBot: Heschi Kreinick <heschi@google.com> Reviewed-by: Rebecca Stambler <rstambler@golang.org>
23 lines
419 B
Go
23 lines
419 B
Go
// +build go1.12
|
|
|
|
package imports
|
|
|
|
import (
|
|
"context"
|
|
"testing"
|
|
)
|
|
|
|
// Tests that we handle GO111MODULE=on with no go.mod file. See #30855.
|
|
func TestNoMainModule(t *testing.T) {
|
|
mt := setup(t, `
|
|
-- x.go --
|
|
package x
|
|
`, "")
|
|
defer mt.cleanup()
|
|
if _, err := mt.env.invokeGo(context.Background(), "mod", "download", "rsc.io/quote@v1.5.1"); err != nil {
|
|
t.Fatal(err)
|
|
}
|
|
|
|
mt.assertScanFinds("rsc.io/quote", "quote")
|
|
}
|