File tree 1 file changed +16
-0
lines changed 1 file changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -157,6 +157,7 @@ func init() {
157
157
Path = []* Tree {t }
158
158
}
159
159
160
+ Loop:
160
161
for _ , p := range filepath .SplitList (os .Getenv ("GOPATH" )) {
161
162
if p == "" {
162
163
continue
@@ -166,6 +167,21 @@ func init() {
166
167
log .Printf ("invalid GOPATH %q: %v" , p , err )
167
168
continue
168
169
}
170
+
171
+ // Check for dupes.
172
+ // TODO(alexbrainman): make this correct under windows (case insensitive).
173
+ for _ , t2 := range Path {
174
+ if t2 .Path != t .Path {
175
+ continue
176
+ }
177
+ if t2 .Goroot {
178
+ log .Printf ("GOPATH is the same as GOROOT: %q" , t .Path )
179
+ } else {
180
+ log .Printf ("duplicate GOPATH entry: %q" , t .Path )
181
+ }
182
+ continue Loop
183
+ }
184
+
169
185
Path = append (Path , t )
170
186
gcImportArgs = append (gcImportArgs , "-I" , t .PkgDir ())
171
187
ldImportArgs = append (ldImportArgs , "-L" , t .PkgDir ())
You can’t perform that action at this time.
0 commit comments