From 01380177b8f24b66a4f72031a7cef38da4753028 Mon Sep 17 00:00:00 2001 From: kslr Date: Fri, 2 Apr 2021 22:04:53 +0800 Subject: [PATCH] refine package prefix cleanup --- common/errors/errors.go | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/common/errors/errors.go b/common/errors/errors.go index a40bdef94..82da2fc49 100644 --- a/common/errors/errors.go +++ b/common/errors/errors.go @@ -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 }