build/ci: Update Go to v1.24, golangci-lint to v1.64.6 and fix issues (#1804)

* build/ci: Update Go to v1.24, golangci-lint to v1.64.5 and fix issues

* Address shazbert's nitters

* linter/config: Fix new linter issue and use versionSize const

* Address gk's nitters and fix additional linter issue after rebase

* Address glorious nits

* staticcheck: Fix additional linter issues after upgrading to Go 1.24.1 and golangci-lint v1.64.6

Also addresses nits

* Improve testing, assertify usage and use common.ErrParsingWSField

* TestCreateNewStrategy: Replace must > should wording
This commit is contained in:
Adrian Gallagher
2025-03-10 16:33:55 +11:00
committed by GitHub
parent c086e281cf
commit d64d56f77c
114 changed files with 5080 additions and 9355 deletions

File diff suppressed because it is too large Load Diff

View File

@@ -3,6 +3,7 @@ syntax = "proto3";
package btrpc;
import "google/api/annotations.proto";
import "google/protobuf/duration.proto";
import "google/protobuf/timestamp.proto";
option go_package = "github.com/thrasher-corp/gocryptotrader/backtester/btrpc";
@@ -151,7 +152,7 @@ message ExchangeCredentials {
}
message DataSettings {
uint64 interval = 1;
google.protobuf.Duration interval = 1;
string datatype = 2;
ApiData api_data = 3;
DatabaseData database_data = 4;
@@ -205,7 +206,7 @@ message ExecuteStrategyFromFileRequest {
bool do_not_store = 3;
google.protobuf.Timestamp start_time_override = 4;
google.protobuf.Timestamp end_time_override = 5;
uint64 interval_override = 6;
google.protobuf.Duration interval_override = 6;
}
message ExecuteStrategyResponse {

View File

@@ -138,8 +138,7 @@
"name": "config.dataSettings.interval",
"in": "query",
"required": false,
"type": "string",
"format": "uint64"
"type": "string"
},
{
"name": "config.dataSettings.datatype",
@@ -426,8 +425,7 @@
"name": "intervalOverride",
"in": "query",
"required": false,
"type": "string",
"format": "uint64"
"type": "string"
}
],
"tags": [
@@ -723,8 +721,7 @@
"type": "object",
"properties": {
"interval": {
"type": "string",
"format": "uint64"
"type": "string"
},
"datatype": {
"type": "string"

View File

@@ -1,6 +1,6 @@
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
// versions:
// - protoc-gen-go-grpc v1.3.0
// - protoc-gen-go-grpc v1.4.0
// - protoc (unknown)
// source: btrpc.proto
@@ -15,8 +15,8 @@ import (
// This is a compile-time assertion to ensure that this generated file
// is compatible with the grpc package it is being compiled against.
// Requires gRPC-Go v1.32.0 or later.
const _ = grpc.SupportPackageIsVersion7
// Requires gRPC-Go v1.62.0 or later.
const _ = grpc.SupportPackageIsVersion8
const (
BacktesterService_ExecuteStrategyFromFile_FullMethodName = "/btrpc.BacktesterService/ExecuteStrategyFromFile"
@@ -54,8 +54,9 @@ func NewBacktesterServiceClient(cc grpc.ClientConnInterface) BacktesterServiceCl
}
func (c *backtesterServiceClient) ExecuteStrategyFromFile(ctx context.Context, in *ExecuteStrategyFromFileRequest, opts ...grpc.CallOption) (*ExecuteStrategyResponse, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(ExecuteStrategyResponse)
err := c.cc.Invoke(ctx, BacktesterService_ExecuteStrategyFromFile_FullMethodName, in, out, opts...)
err := c.cc.Invoke(ctx, BacktesterService_ExecuteStrategyFromFile_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
}
@@ -63,8 +64,9 @@ func (c *backtesterServiceClient) ExecuteStrategyFromFile(ctx context.Context, i
}
func (c *backtesterServiceClient) ExecuteStrategyFromConfig(ctx context.Context, in *ExecuteStrategyFromConfigRequest, opts ...grpc.CallOption) (*ExecuteStrategyResponse, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(ExecuteStrategyResponse)
err := c.cc.Invoke(ctx, BacktesterService_ExecuteStrategyFromConfig_FullMethodName, in, out, opts...)
err := c.cc.Invoke(ctx, BacktesterService_ExecuteStrategyFromConfig_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
}
@@ -72,8 +74,9 @@ func (c *backtesterServiceClient) ExecuteStrategyFromConfig(ctx context.Context,
}
func (c *backtesterServiceClient) ListAllTasks(ctx context.Context, in *ListAllTasksRequest, opts ...grpc.CallOption) (*ListAllTasksResponse, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(ListAllTasksResponse)
err := c.cc.Invoke(ctx, BacktesterService_ListAllTasks_FullMethodName, in, out, opts...)
err := c.cc.Invoke(ctx, BacktesterService_ListAllTasks_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
}
@@ -81,8 +84,9 @@ func (c *backtesterServiceClient) ListAllTasks(ctx context.Context, in *ListAllT
}
func (c *backtesterServiceClient) StartTask(ctx context.Context, in *StartTaskRequest, opts ...grpc.CallOption) (*StartTaskResponse, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(StartTaskResponse)
err := c.cc.Invoke(ctx, BacktesterService_StartTask_FullMethodName, in, out, opts...)
err := c.cc.Invoke(ctx, BacktesterService_StartTask_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
}
@@ -90,8 +94,9 @@ func (c *backtesterServiceClient) StartTask(ctx context.Context, in *StartTaskRe
}
func (c *backtesterServiceClient) StartAllTasks(ctx context.Context, in *StartAllTasksRequest, opts ...grpc.CallOption) (*StartAllTasksResponse, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(StartAllTasksResponse)
err := c.cc.Invoke(ctx, BacktesterService_StartAllTasks_FullMethodName, in, out, opts...)
err := c.cc.Invoke(ctx, BacktesterService_StartAllTasks_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
}
@@ -99,8 +104,9 @@ func (c *backtesterServiceClient) StartAllTasks(ctx context.Context, in *StartAl
}
func (c *backtesterServiceClient) StopTask(ctx context.Context, in *StopTaskRequest, opts ...grpc.CallOption) (*StopTaskResponse, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(StopTaskResponse)
err := c.cc.Invoke(ctx, BacktesterService_StopTask_FullMethodName, in, out, opts...)
err := c.cc.Invoke(ctx, BacktesterService_StopTask_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
}
@@ -108,8 +114,9 @@ func (c *backtesterServiceClient) StopTask(ctx context.Context, in *StopTaskRequ
}
func (c *backtesterServiceClient) StopAllTasks(ctx context.Context, in *StopAllTasksRequest, opts ...grpc.CallOption) (*StopAllTasksResponse, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(StopAllTasksResponse)
err := c.cc.Invoke(ctx, BacktesterService_StopAllTasks_FullMethodName, in, out, opts...)
err := c.cc.Invoke(ctx, BacktesterService_StopAllTasks_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
}
@@ -117,8 +124,9 @@ func (c *backtesterServiceClient) StopAllTasks(ctx context.Context, in *StopAllT
}
func (c *backtesterServiceClient) ClearTask(ctx context.Context, in *ClearTaskRequest, opts ...grpc.CallOption) (*ClearTaskResponse, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(ClearTaskResponse)
err := c.cc.Invoke(ctx, BacktesterService_ClearTask_FullMethodName, in, out, opts...)
err := c.cc.Invoke(ctx, BacktesterService_ClearTask_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
}
@@ -126,8 +134,9 @@ func (c *backtesterServiceClient) ClearTask(ctx context.Context, in *ClearTaskRe
}
func (c *backtesterServiceClient) ClearAllTasks(ctx context.Context, in *ClearAllTasksRequest, opts ...grpc.CallOption) (*ClearAllTasksResponse, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(ClearAllTasksResponse)
err := c.cc.Invoke(ctx, BacktesterService_ClearAllTasks_FullMethodName, in, out, opts...)
err := c.cc.Invoke(ctx, BacktesterService_ClearAllTasks_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
}

View File

@@ -4,8 +4,15 @@ deps:
- remote: buf.build
owner: googleapis
repository: googleapis
commit: 62f35d8aed1149c291d606d958a7ce32
commit: 546238c53f7340c6a2a6099fb863bc1b
digest: shake256:8d75c12f391e392b24c076d05117b47aeddb090add99c70247a8f4389b906a65f61a933c68e54ed8b73a050b967b6b712ba194348b67c3ab3ee26cc2cb25852c
- remote: buf.build
owner: grpc-ecosystem
repository: grpc-gateway
commit: bc28b723cd774c32b6fbc77621518765
commit: 4c5ba75caaf84e928b7137ae5c18c26a
digest: shake256:e174ad9408f3e608f6157907153ffec8d310783ee354f821f57178ffbeeb8faa6bb70b41b61099c1783c82fe16210ebd1279bc9c9ee6da5cffba9f0e675b8b99
- remote: buf.build
owner: protocolbuffers
repository: wellknowntypes
commit: d4f14e5e0a9c40889c90d373c74e95eb
digest: shake256:c9824714afd6cc432c2e1fafa20df47c87a8a0aca9e27192cd5732619453997af1721c2eac5c0fbbe7b29a741af5b8d7ba4ee89c85903e782d9c725d7b9436b5

View File

@@ -14,4 +14,5 @@ breaking:
- FILE
deps:
- buf.build/googleapis/googleapis
- buf.build/protocolbuffers/wellknowntypes
- buf.build/grpc-ecosystem/grpc-gateway