From cc6ddd4c0645aed3be67a70269397f83e6813659 Mon Sep 17 00:00:00 2001 From: wzshiming Date: Sat, 6 May 2017 18:15:23 +0800 Subject: [PATCH] Generate document errors in windows --- utils/utils.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/utils/utils.go b/utils/utils.go index 13e50b1..ed1905f 100644 --- a/utils/utils.go +++ b/utils/utils.go @@ -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 } }