ci(gci/import): improve golangci.yml and add gci linter (#4010)

This commit is contained in:
houseme
2024-12-07 14:17:33 +08:00
committed by GitHub
parent 2066aa4803
commit b0b84a3937
182 changed files with 436 additions and 314 deletions

View File

@ -33,15 +33,13 @@ import (
"github.com/gogf/gf/v2/internal/intlog"
)
var (
// Alias for charsets.
charsetAlias = map[string]string{
"HZGB2312": "HZ-GB-2312",
"hzgb2312": "HZ-GB-2312",
"GB2312": "HZ-GB-2312",
"gb2312": "HZ-GB-2312",
}
)
// Alias for charsets.
var charsetAlias = map[string]string{
"HZGB2312": "HZ-GB-2312",
"hzgb2312": "HZ-GB-2312",
"GB2312": "HZ-GB-2312",
"gb2312": "HZ-GB-2312",
}
// Supported returns whether charset `charset` is supported.
func Supported(charset string) bool {

View File

@ -12,9 +12,10 @@ import (
"reflect"
"strings"
strip "github.com/grokify/html-strip-tags-go"
"github.com/gogf/gf/v2/errors/gcode"
"github.com/gogf/gf/v2/errors/gerror"
strip "github.com/grokify/html-strip-tags-go"
)
// StripTags strips HTML tags from content, and returns only text.

View File

@ -61,7 +61,7 @@ func ParseURL(str string, component int) (map[string]string, error) {
if component == -1 {
component = 1 | 2 | 4 | 8 | 16 | 32 | 64 | 128
}
var components = make(map[string]string)
components := make(map[string]string)
if (component & 1) == 1 {
components["scheme"] = u.Scheme
}