mirror of
https://github.com/golang/go
synced 2024-11-05 22:36:10 -07:00
22 lines
386 B
Go
22 lines
386 B
Go
|
// +build go1.12
|
||
|
|
||
|
package imports
|
||
|
|
||
|
import (
|
||
|
"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("mod", "download", "rsc.io/quote@v1.5.1"); err != nil {
|
||
|
t.Fatal(err)
|
||
|
}
|
||
|
|
||
|
mt.assertScanFinds("rsc.io/quote", "quote")
|
||
|
}
|