refactor: go fix ftw
This commit is contained in:
@@ -1364,7 +1364,7 @@ func TestAuthHandler_ConcurrentAccess(t *testing.T) {
|
||||
concurrency := 10
|
||||
done := make(chan bool, concurrency)
|
||||
|
||||
for i := 0; i < concurrency; i++ {
|
||||
for range concurrency {
|
||||
go func() {
|
||||
req := createLoginRequest(`{"username":"testuser","password":"Password123!"}`)
|
||||
w := httptest.NewRecorder()
|
||||
@@ -1376,7 +1376,7 @@ func TestAuthHandler_ConcurrentAccess(t *testing.T) {
|
||||
}()
|
||||
}
|
||||
|
||||
for i := 0; i < concurrency; i++ {
|
||||
for range concurrency {
|
||||
<-done
|
||||
}
|
||||
})
|
||||
|
||||
@@ -115,10 +115,7 @@ func NewPageHandler(templatesDir string, authService AuthServiceInterface, postR
|
||||
if start >= len(s) {
|
||||
return ""
|
||||
}
|
||||
end := start + length
|
||||
if end > len(s) {
|
||||
end = len(s)
|
||||
}
|
||||
end := min(start+length, len(s))
|
||||
return s[start:end]
|
||||
},
|
||||
"upper": strings.ToUpper,
|
||||
|
||||
Reference in New Issue
Block a user