Skip to content

Commit

Permalink
refine package prefix cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
kslr committed Apr 2, 2021
1 parent b50d692 commit 0138017
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions common/errors/errors.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,8 @@ func (err *Error) pkgPath() string {
return ""
}
path := reflect.TypeOf(err.pathObj).PkgPath()
if strings.HasPrefix(path, "github.com/v2fly/v2ray-core/v4/") {
return path[31:]
}
path = strings.TrimPrefix(path, "github.com/v2fly/v2ray-core/v4")
path = strings.TrimPrefix(path, "github.com/v2fly/v2ray-core/v4/")
return path
}

Expand Down

0 comments on commit 0138017

Please sign in to comment.