From 5563d1ebd999cb59f66fea58283f6b5705e1bc11 Mon Sep 17 00:00:00 2001 From: ccoVeille <3875889+ccoVeille@users.noreply.github.com> Date: Sat, 14 Dec 2024 00:14:08 +0100 Subject: [PATCH] ci: fix the importas rule configuration Also fix the reported issue. --- .golangci.yaml | 7 ++++--- handler.go | 4 ++-- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/.golangci.yaml b/.golangci.yaml index 8b4dfd5..7064a27 100644 --- a/.golangci.yaml +++ b/.golangci.yaml @@ -22,9 +22,10 @@ linters: linters-settings: importas: alias: - # prevent conflicts with std packages - - pkg: github.com/go-sprout/sprout/registry/(\w+) - alias: r$1 + # prevent conflicts with first level std packages + - pkg: "[a-z][0-9a-z]+" + alias: "" + gofumpt: module-path: github.com/go-sprout/sprout misspell: diff --git a/handler.go b/handler.go index f873b58..5757e7f 100644 --- a/handler.go +++ b/handler.go @@ -3,7 +3,7 @@ package sprout import ( "log/slog" "slices" - gostrings "strings" + "strings" "golang.org/x/text/cases" "golang.org/x/text/language" @@ -259,7 +259,7 @@ func safeFuncName(name string) string { return "" } - var b gostrings.Builder + var b strings.Builder b.Grow(len(name) + 4) b.WriteString("safe")