diff --git a/middleware/extractor.go b/middleware/extractor.go index abb603186..f800a49e9 100644 --- a/middleware/extractor.go +++ b/middleware/extractor.go @@ -85,9 +85,9 @@ func createExtractors(lookups string, limit uint) ([]ValuesExtractor, error) { limit = extractorLimit } - sources := strings.Split(lookups, ",") + sources := strings.SplitSeq(lookups, ",") var extractors = make([]ValuesExtractor, 0) - for _, source := range sources { + for source := range sources { parts := strings.Split(source, ":") if len(parts) < 2 { return nil, fmt.Errorf("extractor source for lookup could not be split into needed parts: %v", source) diff --git a/router_test.go b/router_test.go index 7bddb4a15..69b8d4a64 100644 --- a/router_test.go +++ b/router_test.go @@ -2235,8 +2235,8 @@ func testRouterAPI(t *testing.T, api []testRoute) { c.SetRequest(httptest.NewRequest(route.Method, route.Path, nil)) e.router.Route(c) - tokens := strings.Split(route.Path[1:], "/") - for _, token := range tokens { + tokens := strings.SplitSeq(route.Path[1:], "/") + for token := range tokens { if token[0] == ':' { assert.Equal(t, c.pathValues.GetOr(token[1:], "---none---"), token) }