diff --git a/internal/http/handlers/api_session.go b/internal/http/handlers/api_session.go index 10493b5e..c1be4633 100644 --- a/internal/http/handlers/api_session.go +++ b/internal/http/handlers/api_session.go @@ -168,7 +168,7 @@ func (s *apiSession) ApiSessionGetAllRequests(c echo.Context, sessionUuid api.Se var result = make([]api.SessionRequest, 0, len(requests)) - for i := range len(requests) { + for i := range requests { result = append(result, s.convertStoredRequestToApiStruct(requests[i])) } diff --git a/internal/http/middlewares/webhook/webhook.go b/internal/http/middlewares/webhook/webhook.go index 4333f6f3..2a5fb543 100644 --- a/internal/http/middlewares/webhook/webhook.go +++ b/internal/http/middlewares/webhook/webhook.go @@ -30,7 +30,7 @@ func New( //nolint:funlen,gocognit,gocyclo ) echo.MiddlewareFunc { var ignoreHeaderPrefixes = make([]string, len(cfg.IgnoreHeaderPrefixes)) - for i := range len(cfg.IgnoreHeaderPrefixes) { + for i := range cfg.IgnoreHeaderPrefixes { ignoreHeaderPrefixes[i] = strings.ToUpper(strings.TrimSpace(cfg.IgnoreHeaderPrefixes[i])) // normalize each } @@ -174,7 +174,7 @@ loop: if len(ignorePrefixes) > 0 { upperName := strings.ToUpper(name) - for i := range len(ignorePrefixes) { + for i := range ignorePrefixes { if strings.HasPrefix(upperName, ignorePrefixes[i]) { continue loop } diff --git a/internal/storage/redis.go b/internal/storage/redis.go index bf8764db..578fae7d 100644 --- a/internal/storage/redis.go +++ b/internal/storage/redis.go @@ -118,7 +118,7 @@ func (s *Redis) DeleteRequests(sessionUUID string) (bool, error) { // removing plan var keys = []string{key.requests()} - for i := range len(requestUUIDs) { + for i := range requestUUIDs { keys = append(keys, key.request(requestUUIDs[i])) } @@ -194,7 +194,7 @@ func (s *Redis) CreateRequest(sessionUUID, clientAddr, method, uri string, conte forUpdate = append(forUpdate, requestUUIDs...) } - for i := range len(forUpdate) { + for i := range forUpdate { pipe.Expire(s.ctx, key.request(forUpdate[i]), s.ttl) } } @@ -256,7 +256,7 @@ func (s *Redis) GetAllRequests(sessionUUID string) ([]Request, error) { // convert request UUIDs into storage keys keys := make([]string, len(UUIDs)) - for i := range len(UUIDs) { + for i := range UUIDs { keys[i] = key.request(UUIDs[i]) } @@ -266,7 +266,7 @@ func (s *Redis) GetAllRequests(sessionUUID string) ([]Request, error) { return nil, gettingErr } - for i := range len(UUIDs) { + for i := range UUIDs { if packed, ok := rawRequests[i].(string); ok { rData := redisRequest{}