diff options
author | silverwind <me@silverwind.io> | 2024-12-15 03:31:07 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-12-15 02:31:07 +0000 |
commit | 1cfb718976e2db517da0e76bda835edd9df1fabd (patch) | |
tree | 556f0e895ce6d6f35d57266ea9c51e68c7f89ce6 /modules/templates | |
parent | 7616aeb2ea2a02c15480dcd4a232e98081569690 (diff) | |
download | gitea-1cfb718976e2db517da0e76bda835edd9df1fabd.tar.gz gitea-1cfb718976e2db517da0e76bda835edd9df1fabd.zip |
Update golangci-lint to v1.62.2, fix issues (#32845)
Update it and fix new issues related to `redefines-builtin-id`
Diffstat (limited to 'modules/templates')
-rw-r--r-- | modules/templates/util_date.go | 6 | ||||
-rw-r--r-- | modules/templates/util_string.go | 4 |
2 files changed, 5 insertions, 5 deletions
diff --git a/modules/templates/util_date.go b/modules/templates/util_date.go index 66f83d23fe..658691ee40 100644 --- a/modules/templates/util_date.go +++ b/modules/templates/util_date.go @@ -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 } diff --git a/modules/templates/util_string.go b/modules/templates/util_string.go index 479b755da1..2ae27d0833 100644 --- a/modules/templates/util_string.go +++ b/modules/templates/util_string.go @@ -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 { |