Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions middleware/extractor.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
4 changes: 2 additions & 2 deletions router_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down
Loading