mirror of
https://github.com/go-gitea/gitea.git
synced 2026-04-05 14:48:07 +00:00
Update golangci-lint to v2.11.4 (#37059)
Update golangci-lint from v2.11.2 to v2.11.4 and fix new `modernize` lint warnings: - Use `strings.Builder` instead of string concatenation in loop (`evaluator.go`) - Use `atomic.Int64` instead of `int64` with atomic free functions (`logchecker.go`, `timer_test.go`, `integration_test.go`) --- This PR was written with the help of Claude Opus 4.6 Co-authored-by: Claude (Opus 4.6) <noreply@anthropic.com>
This commit is contained in:
@@ -246,13 +246,13 @@ func loginUserWithPassword(t testing.TB, userName, password string) *TestSession
|
||||
}
|
||||
|
||||
// token has to be unique this counter take care of
|
||||
var tokenCounter int64
|
||||
var tokenCounter atomic.Int64
|
||||
|
||||
// getTokenForLoggedInUser returns a token for a logged-in user.
|
||||
func getTokenForLoggedInUser(t testing.TB, session *TestSession, scopes ...auth.AccessTokenScope) string {
|
||||
t.Helper()
|
||||
urlValues := url.Values{}
|
||||
urlValues.Add("name", fmt.Sprintf("api-testing-token-%d", atomic.AddInt64(&tokenCounter, 1)))
|
||||
urlValues.Add("name", fmt.Sprintf("api-testing-token-%d", tokenCounter.Add(1)))
|
||||
for _, scope := range scopes {
|
||||
urlValues.Add("scope-dummy", string(scope)) // it only needs to start with "scope-" to be accepted
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user