mirror of
https://github.com/d0zingcat/gocryptotrader.git
synced 2026-05-13 15:09:42 +00:00
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:
3
.github/workflows/misc.yml
vendored
3
.github/workflows/misc.yml
vendored
@@ -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
|
||||
|
||||
|
||||
|
||||
3
Makefile
3
Makefile
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user