@@ -1055,77 +1055,6 @@ func TestNewReleaseRebuildsStalePackagesInGOPATH(t *testing.T) {
1055
1055
tg .wantNotStale ("p1" , "" , "./testgo list claims p1 is stale after building with old release" )
1056
1056
}
1057
1057
1058
- // cmd/go: custom import path checking should not apply to Go packages without import comment.
1059
- func TestIssue10952 (t * testing.T ) {
1060
- testenv .MustHaveExecPath (t , "git" )
1061
-
1062
- tg := testgo (t )
1063
- defer tg .cleanup ()
1064
- tg .parallel ()
1065
- tg .acquireNet ()
1066
-
1067
- tg .tempDir ("src" )
1068
- tg .setenv ("GOPATH" , tg .path ("." ))
1069
- const importPath = "github.com/zombiezen/go-get-issue-10952"
1070
- tg .run ("get" , "-d" , "-u" , importPath )
1071
- repoDir := tg .path ("src/" + importPath )
1072
- tg .runGit (repoDir , "remote" , "set-url" , "origin" , "https://" + importPath + ".git" )
1073
- tg .run ("get" , "-d" , "-u" , importPath )
1074
- }
1075
-
1076
- // Test git clone URL that uses SCP-like syntax and custom import path checking.
1077
- func TestIssue11457 (t * testing.T ) {
1078
- testenv .MustHaveExecPath (t , "git" )
1079
-
1080
- tg := testgo (t )
1081
- defer tg .cleanup ()
1082
- tg .parallel ()
1083
- tg .acquireNet ()
1084
-
1085
- tg .tempDir ("src" )
1086
- tg .setenv ("GOPATH" , tg .path ("." ))
1087
- const importPath = "rsc.io/go-get-issue-11457"
1088
- tg .run ("get" , "-d" , "-u" , importPath )
1089
- repoDir := tg .path ("src/" + importPath )
1090
- tg .
runGit (
repoDir ,
"remote" ,
"set-url" ,
"origin" ,
"[email protected] :rsc/go-get-issue-11457" )
1091
-
1092
- // At this time, custom import path checking compares remotes verbatim (rather than
1093
- // just the host and path, skipping scheme and user), so we expect go get -u to fail.
1094
- // However, the goal of this test is to verify that gitRemoteRepo correctly parsed
1095
- // the SCP-like syntax, and we expect it to appear in the error message.
1096
- tg .runFail ("get" , "-d" , "-u" , importPath )
1097
- want := " is checked out from ssh://[email protected] /rsc/go-get-issue-11457"
1098
- if ! strings .HasSuffix (strings .TrimSpace (tg .getStderr ()), want ) {
1099
- t .Error ("expected clone URL to appear in stderr" )
1100
- }
1101
- }
1102
-
1103
- func TestGetGitDefaultBranch (t * testing.T ) {
1104
- testenv .MustHaveExecPath (t , "git" )
1105
-
1106
- tg := testgo (t )
1107
- defer tg .cleanup ()
1108
- tg .parallel ()
1109
- tg .acquireNet ()
1110
-
1111
- tg .tempDir ("src" )
1112
- tg .setenv ("GOPATH" , tg .path ("." ))
1113
-
1114
- // This repo has two branches, master and another-branch.
1115
- // The another-branch is the default that you get from 'git clone'.
1116
- // The go get command variants should not override this.
1117
- const importPath = "github.com/rsc/go-get-default-branch"
1118
-
1119
- tg .run ("get" , "-d" , importPath )
1120
- repoDir := tg .path ("src/" + importPath )
1121
- tg .runGit (repoDir , "branch" , "--contains" , "HEAD" )
1122
- tg .grepStdout (`\* another-branch` , "not on correct default branch" )
1123
-
1124
- tg .run ("get" , "-d" , "-u" , importPath )
1125
- tg .runGit (repoDir , "branch" , "--contains" , "HEAD" )
1126
- tg .grepStdout (`\* another-branch` , "not on correct default branch" )
1127
- }
1128
-
1129
1058
func TestPackageMainTestCompilerFlags (t * testing.T ) {
1130
1059
tg := testgo (t )
1131
1060
defer tg .cleanup ()
@@ -1442,35 +1371,6 @@ func TestDefaultGOPATH(t *testing.T) {
1442
1371
tg .grepStdoutNot ("." , "want unset GOPATH because GOROOT=$HOME/go/" )
1443
1372
}
1444
1373
1445
- func TestDefaultGOPATHGet (t * testing.T ) {
1446
- testenv .MustHaveExecPath (t , "git" )
1447
-
1448
- tg := testgo (t )
1449
- defer tg .cleanup ()
1450
- tg .parallel ()
1451
- tg .acquireNet ()
1452
-
1453
- tg .setenv ("GOPATH" , "" )
1454
- tg .tempDir ("home" )
1455
- tg .setenv (homeEnvName (), tg .path ("home" ))
1456
-
1457
- // warn for creating directory
1458
- tg .run ("get" , "-v" , "github.com/golang/example/hello" )
1459
- tg .grepStderr ("created GOPATH=" + regexp .QuoteMeta (tg .path ("home/go" ))+ "; see 'go help gopath'" , "did not create GOPATH" )
1460
-
1461
- // no warning if directory already exists
1462
- tg .must (robustio .RemoveAll (tg .path ("home/go" )))
1463
- tg .tempDir ("home/go" )
1464
- tg .run ("get" , "github.com/golang/example/hello" )
1465
- tg .grepStderrNot ("." , "expected no output on standard error" )
1466
-
1467
- // error if $HOME/go is a file
1468
- tg .must (robustio .RemoveAll (tg .path ("home/go" )))
1469
- tg .tempFile ("home/go" , "" )
1470
- tg .runFail ("get" , "github.com/golang/example/hello" )
1471
- tg .grepStderr (`mkdir .*[/\\]go: .*(not a directory|cannot find the path)` , "expected error because $HOME/go is a file" )
1472
- }
1473
-
1474
1374
func TestDefaultGOPATHPrintedSearchList (t * testing.T ) {
1475
1375
tg := testgo (t )
1476
1376
defer tg .cleanup ()
0 commit comments