Skip to content

Commit

Permalink
Merge pull request #136 from tianhai82/master
Browse files Browse the repository at this point in the history
fix GOPATH case mismatch issue
  • Loading branch information
vektah authored Jun 21, 2018
2 parents a34b4de + 63976d5 commit d26ef2a
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion codegen/codegen.go
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,9 @@ func fullPackageName(dir string, pkgName string) string {

for _, gopath := range filepath.SplitList(build.Default.GOPATH) {
gopath = filepath.Join(gopath, "src") + string(os.PathSeparator)
fullPkgName = strings.TrimPrefix(fullPkgName, gopath)
if strings.EqualFold(gopath, fullPkgName[0:len(gopath)]) {
fullPkgName = fullPkgName[len(gopath):]
}
}
return filepath.ToSlash(fullPkgName)
}
Expand Down

0 comments on commit d26ef2a

Please sign in to comment.