1
0
mirror of https://github.com/golang/go synced 2024-11-18 14:14:46 -07:00
go/internal/imports/mod_112_test.go

23 lines
419 B
Go
Raw Normal View History

// +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")
}