wildcardOkay := len(*stk) == 0
isWildcard := false
- // Note: Do not stk.push(arg) and defer stk.pop() here.
- // The push/pop below are using updated values of arg in some cases.
-
// Download if the package is missing, or update if we're using -u.
if p.Dir == "" || *getU {
// The actual download.
pkgs = pkgs[:0]
for _, arg := range args {
- stk.push(arg)
+ // Note: load calls loadPackage or loadImport,
+ // which push arg onto stk already.
+ // Do not push here too, or else stk will say arg imports arg.
p := load(arg, mode)
- stk.pop()
if p.Error != nil {
errorf("%s", p.Error)
continue
tg.grepStdoutNot("no", "go generate -run yes ./testdata/generate/test4.go selected no")
}
-func TestGoGetWorksWithVanityWildcards(t *testing.T) {
+func TestGoGetCustomDomainWildcard(t *testing.T) {
testenv.MustHaveExternalNetwork(t)
tg := testgo(t)
tg.wantExecutable(tg.path("bin/pdfpasswd"+exeSuffix), "did not build rsc/io/pdf/pdfpasswd")
}
+func TestGoGetInternalWildcard(t *testing.T) {
+ testenv.MustHaveExternalNetwork(t)
+
+ tg := testgo(t)
+ defer tg.cleanup()
+ tg.makeTempdir()
+ tg.setenv("GOPATH", tg.path("."))
+ // used to fail with errors about internal packages
+ tg.run("get", "github.com/rsc/go-get-issue-11960/...")
+}
+
func TestGoVetWithExternalTests(t *testing.T) {
testenv.MustHaveExternalNetwork(t)