Fix filepath (#990)

This commit is contained in:
anqiansong
2021-09-04 08:15:22 +08:00
committed by GitHub
parent c26c187e11
commit 2125977281
4 changed files with 112 additions and 1 deletions

View File

@@ -21,8 +21,18 @@ func projectFromGoPath(workDir string) (*ProjectContext, error) {
return nil, err
}
workDir, err := util.ReadLink(workDir)
if err != nil {
return nil, err
}
buildContext := build.Default
goPath := buildContext.GOPATH
goPath, err = util.ReadLink(goPath)
if err != nil {
return nil, err
}
goSrc := filepath.Join(goPath, "src")
if !util.FileExists(goSrc) {
return nil, errModuleCheck