mirror of
https://github.com/netbirdio/easyjson.git
synced 2026-05-22 18:44:42 -07:00
Fixes #4: support GOPATH entries ending in '/'.
This commit is contained in:
@@ -17,7 +17,7 @@ func getPkgPath(fname string) (string, error) {
|
||||
}
|
||||
|
||||
for _, p := range strings.Split(os.Getenv("GOPATH"), ":") {
|
||||
prefix := p + "/src/"
|
||||
prefix := path.Join(p, "src") + "/"
|
||||
if rel := strings.TrimPrefix(fname, prefix); rel != fname {
|
||||
return path.Dir(rel), nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user