Skip to content
This repository was archived by the owner on Sep 9, 2020. It is now read-only.

Commit 5e004f4

Browse files
authored
Merge pull request #1185 from sdboyer/improve-GOPATH-err
ctx: improve "not under GOPATH" errors
2 parents 10ef770 + 2c2fb85 commit 5e004f4

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

context.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,7 @@ func (c *Ctx) detectGOPATH(path string) (string, error) {
223223
return gp, nil
224224
}
225225
}
226-
return "", errors.Errorf("%s is not within a known GOPATH", path)
226+
return "", errors.Errorf("%s is not within a known GOPATH/src", path)
227227
}
228228

229229
// ImportForAbs returns the import path for an absolute project path by trimming the
@@ -244,7 +244,7 @@ func (c *Ctx) ImportForAbs(path string) (string, error) {
244244
return filepath.ToSlash(path[len(srcprefix):]), nil
245245
}
246246

247-
return "", errors.Errorf("%s not in GOPATH", path)
247+
return "", errors.Errorf("%s is not within any GOPATH/src", path)
248248
}
249249

250250
// AbsForImport returns the absolute path for the project root

0 commit comments

Comments
 (0)