modernize: Exclude specific packages and improve URL query string handling (#2131)

* modernize: exclude specific packages and improve URL query string handling

* refactor: simplify URL query string removal in websocket connection
This commit is contained in:
Adrian Gallagher
2025-12-17 09:26:58 +11:00
committed by GitHub
parent 43d83769ec
commit b1e4983f49
3 changed files with 6 additions and 6 deletions

View File

@@ -85,6 +85,7 @@ jobs:
- name: Check Go modernise tool issues
run: |
go run golang.org/x/tools/gopls/internal/analysis/modernize/cmd/modernize@latest -test ./...
pkgs=$(go list ./... | grep -vE '/gctrpc$|/backtester/btrpc$|/database/models/')
go run golang.org/x/tools/gopls/internal/analysis/modernize/cmd/modernize@latest -test $pkgs

View File

@@ -43,7 +43,8 @@ gofumpt:
modernise:
@command -v modernize >/dev/null 2>&1 || go install golang.org/x/tools/gopls/internal/analysis/modernize/cmd/modernize@latest
modernize -test ./...
@pkgs=$$(go list ./... | grep -vE '/gctrpc$$|/backtester/btrpc$$|/database/models/'); \
modernize -test $$pkgs
update_deps:
go mod verify

View File

@@ -458,10 +458,8 @@ func (c *connection) MatchReturnResponses(ctx context.Context, signature any, ex
}
func removeURLQueryString(u string) string {
if index := strings.Index(u, "?"); index != -1 {
return u[:index]
}
return u
baseURL, _, _ := strings.Cut(u, "?")
return baseURL
}
// RequireMatchWithData routes incoming data using the connection specific match system to the correct handler