build/ci: Update Go to v1.24, golangci-lint to v1.64.5 and fix issues#1804
build/ci: Update Go to v1.24, golangci-lint to v1.64.5 and fix issues#1804thrasher- merged 8 commits intothrasher-corp:masterfrom
Conversation
There was a problem hiding this comment.
Copilot reviewed 90 out of 105 changed files in this pull request and generated 1 comment.
Files not reviewed (15)
- .github/workflows/arm64.Dockerfile: Language not supported
- Dockerfile: Language not supported
- Makefile: Language not supported
- backtester/btrpc/btrpc.swagger.json: Language not supported
- cmd/gctcli/data_history.go: Evaluated as low risk
- backtester/data/kline/kline.go: Evaluated as low risk
- backtester/btrpc/btrpc.proto: Evaluated as low risk
- backtester/engine/setup.go: Evaluated as low risk
- cmd/gen_sqlboiler_config/main.go: Evaluated as low risk
- .github/workflows/linter.yml: Evaluated as low risk
- backtester/engine/grpcserver_test.go: Evaluated as low risk
- .github/workflows/proto-lint.yml: Evaluated as low risk
- backtester/btrpc/btrpc_grpc.pb.go: Evaluated as low risk
- backtester/engine/grpcserver.go: Evaluated as low risk
- .github/workflows/tests.yml: Evaluated as low risk
Comments suppressed due to low confidence (2)
backtester/config/strategyconfigbuilder/main.go:432
- Ensure that the port value is correctly handled as uint32 throughout the codebase to avoid potential overflow issues.
port, err = strconv.ParseUint(input, 10, 32)
backtester/config/strategyconfigbuilder/main.go:437
- [nitpick] The comment
//nolint:gosec // No overflow riskneeds to be justified better. Ensure that there is indeed no overflow risk.
cfg.DataSettings.DatabaseData.Config.Port = uint32(port) //nolint:gosec // No overflow risk
backtester/btcli/commands.go
Outdated
| } | ||
|
|
||
| var intervalOverride uint64 | ||
| var intervalOverride int64 |
There was a problem hiding this comment.
Add a check to ensure intervalOverride is not negative before converting it to time.Duration.
shazbert
left a comment
There was a problem hiding this comment.
Good stuff! nothing major I could see.
cdba415 to
27b8e73
Compare
shazbert
left a comment
There was a problem hiding this comment.
tACK tested old config encryption to this from master 🚀
27b8e73 to
311c8a8
Compare
gbjk
left a comment
There was a problem hiding this comment.
Looks good 👍
Only nits, and a few pedantic suggestions.
9c98fb6 to
dee6f63
Compare
shazbert
left a comment
There was a problem hiding this comment.
One suggestion changes look good.
gloriousCode
left a comment
There was a problem hiding this comment.
That was a slog. Only thing that really stood out was usetesting being commented out
config/config_encryption.go
Outdated
| totalLen := len(encryptionPrefix) + len(c.storedSalt) + len(encryptionVersionPrefix) + versionSize + len(ciphertext) | ||
| appendedFile := make([]byte, totalLen) |
There was a problem hiding this comment.
I'm easy, but arguably:
| totalLen := len(encryptionPrefix) + len(c.storedSalt) + len(encryptionVersionPrefix) + versionSize + len(ciphertext) | |
| appendedFile := make([]byte, totalLen) | |
| appendedFile := make([]byte, len(encryptionPrefix) + len(c.storedSalt) + len(encryptionVersionPrefix) + versionSize + len(ciphertext)) |
For me, it's very implicit that the maths there amounts to "total length"
engine/engine_test.go
Outdated
| assert.NotEmpty(t, defaultCfg.Name) | ||
| assert.True(t, defaultCfg.Enabled) |
There was a problem hiding this comment.
I think that when you're not testing the overall thing, you have to add context for the error.
That is: require.NotEmpty(t, defaultCfg) is fine, because it's about the unit test's target func main return value.
| assert.NotEmpty(t, defaultCfg.Name) | |
| assert.True(t, defaultCfg.Enabled) | |
| assert.NotEmpty(t, defaultCfg.Name, "Name should not be empty") | |
| assert.True(t, defaultCfg.Enabled, "Enabled should have correct value") |
|
This PR is pending release of sonic's next release: bytedance/sonic#741 (comment) which should land next week |
| t.Errorf("received '%v' expected '%v'", resp, nil) | ||
| } | ||
| assert.ErrorIs(t, err, common.ErrNilPointer) | ||
| assert.Nil(t, resp) |
There was a problem hiding this comment.
🦟 Don't think we should need to check what resp is when err is not nil 🙂
| assert.Nil(t, resp) |
| h = new(dollarcostaverage.Strategy) | ||
| resp, err = createNewStrategy(dollarcostaverage.Name, true, h) | ||
| assert.NoError(t, err, "createNewStrategy should not error") | ||
| assert.NotNil(t, resp) |
There was a problem hiding this comment.
🦟 Nit:
| assert.NotNil(t, resp) | |
| assert.NotSame(t, h, resp, "createNewStrategy must return a new pointer") |
shazbert
left a comment
There was a problem hiding this comment.
Just something I noticed on new changes. Thanks!
engine/engine_test.go
Outdated
| assert.Positive(t, defaultCfg.WebsocketResponseCheckTimeout, 0) | ||
| assert.Positive(t, defaultCfg.WebsocketResponseMaxLimit, 0) | ||
| assert.Positive(t, defaultCfg.WebsocketTrafficTimeout, 0) |
There was a problem hiding this comment.
| assert.Positive(t, defaultCfg.WebsocketResponseCheckTimeout, 0) | |
| assert.Positive(t, defaultCfg.WebsocketResponseMaxLimit, 0) | |
| assert.Positive(t, defaultCfg.WebsocketTrafficTimeout, 0) | |
| assert.Positive(t, defaultCfg.WebsocketResponseCheckTimeout) | |
| assert.Positive(t, defaultCfg.WebsocketResponseMaxLimit) | |
| assert.Positive(t, defaultCfg.WebsocketTrafficTimeout) |
…1 and golangci-lint v1.64.6 Also addresses nits
070e09e to
39e5479
Compare
PR Description
Bumps Go to v1.24, golangci-lint to v1.64.5 and fixes the issues it found.
Summary of changes:
for i := 0; i < b.N; i++loops and suggested to use a range as is standard now, however I opted instead to use b.Loop() which is new in Go1.24.kline.CalculateCandleDateRangeshad a potential divide by 0 panic bug if limit was set to 0.Type of change
How has this been tested
Checklist