1
1
mirror of https://github.com/go-gitea/gitea synced 2025-07-22 18:28:37 +00:00

Update golangci-lint to v1.62.2, fix issues (#32845)

Update it and fix new issues related to `redefines-builtin-id`
This commit is contained in:
silverwind
2024-12-15 03:31:07 +01:00
committed by GitHub
parent 7616aeb2ea
commit 1cfb718976
13 changed files with 36 additions and 36 deletions

View File

@@ -53,8 +53,8 @@ func parseLegacy(datetime string) time.Time {
return t
}
func anyToTime(any any) (t time.Time, isZero bool) {
switch v := any.(type) {
func anyToTime(value any) (t time.Time, isZero bool) {
switch v := value.(type) {
case nil:
// it is zero
case *time.Time:
@@ -72,7 +72,7 @@ func anyToTime(any any) (t time.Time, isZero bool) {
case int64:
t = timeutil.TimeStamp(v).AsTime()
default:
panic(fmt.Sprintf("Unsupported time type %T", any))
panic(fmt.Sprintf("Unsupported time type %T", value))
}
return t, t.IsZero() || t.Unix() == 0
}

View File

@@ -53,8 +53,8 @@ func (su *StringUtils) Cut(s, sep string) []any {
return []any{before, after, found}
}
func (su *StringUtils) EllipsisString(s string, max int) string {
return base.EllipsisString(s, max)
func (su *StringUtils) EllipsisString(s string, maxLength int) string {
return base.EllipsisString(s, maxLength)
}
func (su *StringUtils) ToUpper(s string) string {