Merge commit 'cc6ddd4c0645aed3be67a70269397f83e6813659' into develop

This commit is contained in:
wzshiming 2017-05-06 19:36:04 +08:00
commit 751baf5070
1 changed files with 2 additions and 1 deletions

View File

@ -61,7 +61,8 @@ func GetGOPATHs() []string {
// IsInGOPATH checks whether the path is inside of any GOPATH or not
func IsInGOPATH(thePath string) bool {
for _, gopath := range GetGOPATHs() {
if strings.Contains(thePath, filepath.Join(gopath, "src")) {
b, _ := filepath.Rel(thePath, filepath.Join(gopath, "src"))
if strings.Contains(b, "..") {
return true
}
}