Skip to content

Commit ccad700

Browse files
committed
Merge pull request gopherjs#368 from casey/no-gopath-fix
Make error friendlier if GOPATH is not set
2 parents 6ed7594 + 6d1718b commit ccad700

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

tool.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,11 @@ func init() {
4646
fmt.Fprintln(os.Stderr, err)
4747
os.Exit(1)
4848
}
49+
gopaths := filepath.SplitList(build.Default.GOPATH)
50+
if len(gopaths) == 0 {
51+
fmt.Fprintf(os.Stderr, "$GOPATH not set. For more details see: go help gopath\n")
52+
os.Exit(1)
53+
}
4954
}
5055

5156
func main() {

0 commit comments

Comments
 (0)