From 9c3e66a9ca57186c808441ba4cae3e39fd5e8cdd Mon Sep 17 00:00:00 2001 From: GoEdgeLab Date: Fri, 11 Aug 2023 16:14:47 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E9=94=99=E8=AF=AF=E5=A4=84?= =?UTF-8?q?=E7=90=86=E7=9B=B8=E5=85=B3=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pkg/serverconfigs/shared/url_pattern.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkg/serverconfigs/shared/url_pattern.go b/pkg/serverconfigs/shared/url_pattern.go index ef169a1..7d6854b 100644 --- a/pkg/serverconfigs/shared/url_pattern.go +++ b/pkg/serverconfigs/shared/url_pattern.go @@ -3,7 +3,7 @@ package shared import ( - "errors" + "fmt" "regexp" "strings" ) @@ -50,7 +50,7 @@ func (this *URLPattern) Init() error { } reg, err := regexp.Compile(pattern) if err != nil { - return errors.New("compile '" + pattern + "' failed: " + err.Error()) + return fmt.Errorf("compile '%s' failed: %w", pattern, err) } this.reg = reg }