chore(deps): bump tool deps and pin, update golangci-lint (#37574)

1. Pin all makefile go deps to exact version, renovate will bump them in the future
2. Bump all deps and golangci-lint and fix all new issues, most are from modernize

Signed-off-by: silverwind <me@silverwind.io>
Co-authored-by: Claude (Opus 4.7) <noreply@anthropic.com>
This commit is contained in:
silverwind
2026-05-08 06:49:34 +02:00
committed by GitHub
parent b4085c7e3c
commit 82d40296b0
11 changed files with 24 additions and 24 deletions
+1 -1
View File
@@ -57,7 +57,7 @@ func (t *Task) IsEnabled() bool {
// GetConfig will return a copy of the task's config
func (t *Task) GetConfig() Config {
if reflect.TypeOf(t.config).Kind() == reflect.Ptr {
if reflect.TypeOf(t.config).Kind() == reflect.Pointer {
// Pointer:
return reflect.New(reflect.ValueOf(t.config).Elem().Type()).Interface().(Config)
}
+2 -2
View File
@@ -6,6 +6,7 @@ package gitdiff
import (
"bytes"
"html/template"
"slices"
"strings"
"unicode/utf8"
@@ -385,8 +386,7 @@ func (hcd *highlightCodeDiff) recoverOneDiff(str string) template.HTML {
}
// close all opening tags
for i := len(tagStack) - 1; i >= 0; i-- {
tagToClose := tagStack[i]
for _, tagToClose := range slices.Backward(tagStack) {
// get the closing tag "</span>" from "<span class=...>" or "<span>"
pos := strings.IndexAny(tagToClose, " >")
// pos must be positive, because the tags were pushed by us
+2 -3
View File
@@ -10,6 +10,7 @@ import (
"html"
"net/url"
"regexp"
"slices"
"strconv"
"strings"
"time"
@@ -123,9 +124,7 @@ func getIssueFromRef(ctx context.Context, repo *repo_model.Repository, index int
// UpdateIssuesCommit checks if issues are manipulated by commit message.
func UpdateIssuesCommit(ctx context.Context, doer *user_model.User, repo *repo_model.Repository, commits []*repository.PushCommit, branchName string) error {
// Commits are appended in the reverse order.
for i := len(commits) - 1; i >= 0; i-- {
c := commits[i]
for _, c := range slices.Backward(commits) {
type markKey struct {
ID int64
Action references.XRefAction
+2 -2
View File
@@ -9,6 +9,7 @@ import (
"fmt"
"io"
"regexp"
"slices"
"strings"
"time"
"unicode/utf8"
@@ -845,8 +846,7 @@ func GetSquashMergeCommitMessages(ctx context.Context, pr *issues_model.PullRequ
// use PR's commit messages as squash commit message
// commits list is in reverse chronological order
maxMsgSize := setting.Repository.PullRequest.DefaultMergeMessageSize
for i := len(commits) - 1; i >= 0; i-- {
commit := commits[i]
for _, commit := range slices.Backward(commits) {
msg := strings.TrimSpace(commit.MessageUTF8())
if msg == "" {
continue
+2 -2
View File
@@ -6,6 +6,7 @@ package gitgraph
import (
"bytes"
"fmt"
"slices"
)
// Parser represents a git graph parser. It is stateful containing the previous
@@ -163,8 +164,7 @@ func (parser *Parser) ParseGlyphs(glyphs []byte) {
// release unused colors
parser.releaseUnusedColors()
for i := len(glyphs) - 1; i >= 0; i-- {
glyph := glyphs[i]
for i, glyph := range slices.Backward(glyphs) {
switch glyph {
case '|':
fallthrough