diff --git a/build.go b/build.go index 8bd2fa67..3744feb1 100644 --- a/build.go +++ b/build.go @@ -218,11 +218,18 @@ func main() { os.Setenv("GOPATH", gopath) log.Println("GOPATH is", gopath) } else { - gopath, _ = filepath.EvalSymlinks(gopath) + inside := false wd, _ := os.Getwd() wd, _ = filepath.EvalSymlinks(wd) - if filepath.Join(gopath, "src/github.com/syncthing/syncthing") != wd { - fmt.Println("You are running this outside of GOPATH/src/github.com/syncthing/syncthing, this might cause failure!") + for _, p := range filepath.SplitList(gopath) { + p, _ = filepath.EvalSymlinks(p) + if filepath.Join(p, "src/github.com/syncthing/syncthing") == wd { + inside = true + break + } + } + if !inside { + fmt.Println("You seem to have GOPATH set but the Syncthing source not placed correctly within it, which may cause problems.") } }