Skip to content

Commit c7646fe

Browse files
chore: bump go from 1.25 to 1.26.0 google.golang.org/api from 0.267.0 to 0.269.0 (#864)
* chore: bump google.golang.org/api from 0.267.0 to 0.269.0 Bumps [google.golang.org/api](https://github.com/googleapis/google-api-go-client) from 0.267.0 to 0.269.0. - [Release notes](https://github.com/googleapis/google-api-go-client/releases) - [Changelog](https://github.com/googleapis/google-api-go-client/blob/main/CHANGES.md) - [Commits](googleapis/google-api-go-client@v0.267.0...v0.269.0) --- updated-dependencies: - dependency-name: google.golang.org/api dependency-version: 0.269.0 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> * chore: bump go to 1.26.0 * fix: typo * chore: bump golangci-lint --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: leovct <l009.vincent@gmail.com>
1 parent 95f68dd commit c7646fe

55 files changed

Lines changed: 378 additions & 261 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/ci.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ concurrency:
1414
cancel-in-progress: ${{ startsWith(github.ref, 'refs/pull/') }}
1515

1616
env:
17-
GO_VERSION: "1.24.1" # https://go.dev/dl/
17+
GO_VERSION: "1.26.0"
1818
FOUNDRY_VERSION: stable
1919

2020
jobs:
@@ -27,7 +27,7 @@ jobs:
2727
with:
2828
go-version: ${{ env.GO_VERSION }}
2929
- name: Install golangci-lint
30-
run: curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v1.64.8
30+
run: curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v2.10.1
3131
- name: Install shadow
3232
run: go install golang.org/x/tools/go/analysis/passes/shadow/cmd/shadow@v0.37.0
3333
- name: Run all the linter tools against code

.github/workflows/release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ permissions:
1010
contents: write
1111

1212
env:
13-
GO_VERSION: "1.24.1"
13+
GO_VERSION: "1.26.0"
1414

1515
jobs:
1616
manual-release:

.golangci.yml

Lines changed: 0 additions & 5 deletions
This file was deleted.

CLAUDE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ Always run `make gen` before committing if you've changed anything that affects
111111

112112
## Key Dependencies
113113

114-
- Go 1.24+ required
114+
- Go 1.26+ required
115115
- Foundry (for smart contract compilation)
116116
- Docker (for generation tasks)
117117
- Additional tools: jq, bc, protoc (for development)

abi/abi.go

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -260,7 +260,7 @@ func (f FunctionArgType) EncodeInput(object Object) (EncodedItem, error) {
260260
case f.Tuple != nil:
261261
// Tuple is less complicated than arrays since we just iterate through each items
262262
if len(object.Tuple.Elements) != len(f.Tuple.Elements) {
263-
return EncodedItem{}, fmt.Errorf("Mismatched length of tuple elements. Expected: %d elements, received %d", len(f.Tuple.Elements), len(object.Tuple.Elements))
263+
return EncodedItem{}, fmt.Errorf("mismatched length of tuple elements. Expected: %d elements, received %d", len(f.Tuple.Elements), len(object.Tuple.Elements))
264264
}
265265

266266
for idx, tupleItemObject := range object.Tuple.Elements {
@@ -285,49 +285,49 @@ func (f FunctionArgType) EncodeInput(object Object) (EncodedItem, error) {
285285
}
286286
convertedVal, conversionErr = ConvertString(stringVal)
287287
if conversionErr != nil {
288-
return EncodedItem{}, fmt.Errorf("Failed to convert %s to an %s type. %v", object.Val, f.Type, conversionErr)
288+
return EncodedItem{}, fmt.Errorf("failed to convert %s to an %s type. %v", object.Val, f.Type, conversionErr)
289289
}
290290
return EncodedItem{Tail: convertedVal}, nil
291291
case f.Type == "bytes":
292292
convertedVal, conversionErr = ConvertBytes(object.Val)
293293
if conversionErr != nil {
294-
return EncodedItem{}, fmt.Errorf("Failed to convert %s to an %s type. %v", object.Val, f.Type, conversionErr)
294+
return EncodedItem{}, fmt.Errorf("failed to convert %s to an %s type. %v", object.Val, f.Type, conversionErr)
295295
}
296296
return EncodedItem{Tail: convertedVal}, nil
297297
case strings.HasPrefix(f.Type, "int"):
298298
// TODO: validate input is within int<size> limit
299299
convertedVal, conversionErr = ConvertInt(object.Val)
300300
if conversionErr != nil {
301-
return EncodedItem{}, fmt.Errorf("Failed to convert %s to an %s type. %v", object.Val, f.Type, conversionErr)
301+
return EncodedItem{}, fmt.Errorf("failed to convert %s to an %s type. %v", object.Val, f.Type, conversionErr)
302302
}
303303
return EncodedItem{Head: convertedVal}, nil
304304
case strings.HasPrefix(f.Type, "uint"):
305305
// TODO: validate input is within uint<size> limit
306306
convertedVal, conversionErr = ConvertUint(object.Val)
307307
if conversionErr != nil {
308-
return EncodedItem{}, fmt.Errorf("Failed to convert %s to an %s type. %v", object.Val, f.Type, conversionErr)
308+
return EncodedItem{}, fmt.Errorf("failed to convert %s to an %s type. %v", object.Val, f.Type, conversionErr)
309309
}
310310
return EncodedItem{Head: convertedVal}, nil
311311
case strings.Contains(f.Type, "bool"):
312312
convertedVal, conversionErr = ConvertBool(object.Val)
313313
if conversionErr != nil {
314-
return EncodedItem{}, fmt.Errorf("Failed to convert %s to an %s type. %v", object.Val, f.Type, conversionErr)
314+
return EncodedItem{}, fmt.Errorf("failed to convert %s to an %s type. %v", object.Val, f.Type, conversionErr)
315315
}
316316
return EncodedItem{Head: convertedVal}, nil
317317
case strings.HasPrefix(f.Type, "bytes"):
318318
convertedVal, conversionErr = ConvertByteSize(object.Val, f.Type)
319319
if conversionErr != nil {
320-
return EncodedItem{}, fmt.Errorf("Failed to convert %s to an %s type. %v", object.Val, f.Type, conversionErr)
320+
return EncodedItem{}, fmt.Errorf("failed to convert %s to an %s type. %v", object.Val, f.Type, conversionErr)
321321
}
322322
return EncodedItem{Head: convertedVal}, nil
323323
case f.Type == "address":
324324
convertedVal, conversionErr = ConvertAddress(object.Val)
325325
if conversionErr != nil {
326-
return EncodedItem{}, fmt.Errorf("Failed to convert %s to an %s type. %v", object.Val, f.Type, conversionErr)
326+
return EncodedItem{}, fmt.Errorf("failed to convert %s to an %s type. %v", object.Val, f.Type, conversionErr)
327327
}
328328
return EncodedItem{Head: convertedVal}, nil
329329
default:
330-
return EncodedItem{}, fmt.Errorf("Invalid type %s", f.Type)
330+
return EncodedItem{}, fmt.Errorf("invalid type %s", f.Type)
331331
}
332332

333333
// backfill dynamic types...
@@ -433,13 +433,13 @@ func rightPadWithZeros(value string, targetLen int) string {
433433
// ConvertInt converts an int input to the 32 byte hex encoding, left padded with 0s
434434
func ConvertInt(value string) (string, error) {
435435
if len(value) < 1 {
436-
return "", fmt.Errorf("Error: expected at least one digit")
436+
return "", fmt.Errorf("expected at least one digit")
437437
}
438438
bigInt := new(big.Int)
439439

440440
_, ok := bigInt.SetString(value, 10)
441441
if !ok {
442-
return "", fmt.Errorf("Error: Invalid integer string. Failed to convert %s to big int", value)
442+
return "", fmt.Errorf("invalid integer string, failed to convert %s to big int", value)
443443
}
444444

445445
var hexString string
@@ -469,17 +469,17 @@ func ConvertInt(value string) (string, error) {
469469
// ConvertUint converts a uint input to the 32 byte hex encoding, left padded with 0s
470470
func ConvertUint(value string) (string, error) {
471471
if len(value) < 1 {
472-
return "", fmt.Errorf("Error: expected at least one digit")
472+
return "", fmt.Errorf("expected at least one digit")
473473
}
474474
if value[0] == '-' {
475-
return "", fmt.Errorf("Error: Invalid integer string. %s can't be negative", value)
475+
return "", fmt.Errorf("invalid integer string, %s can't be negative", value)
476476
}
477477

478478
bigInt := new(big.Int)
479479

480480
_, ok := bigInt.SetString(value, 10)
481481
if !ok {
482-
return "", fmt.Errorf("Error: Invalid integer string. Failed to convert %s to big int", value)
482+
return "", fmt.Errorf("invalid integer string, failed to convert %s to big int", value)
483483
}
484484

485485
// Convert to hexadecimal representation
@@ -529,7 +529,7 @@ func ConvertString(value string) (string, error) {
529529
// NOTE: this is similar to ConvertString but `value` is expected to be a hex input already
530530
func ConvertBytes(value string) (string, error) {
531531
if len(value)%2 != 0 {
532-
return "", fmt.Errorf("Odd number of digits")
532+
return "", fmt.Errorf("odd number of digits")
533533
}
534534

535535
valueSize := len(value) / 2 // it's hex so / 2 for actual length in bytes
@@ -561,8 +561,8 @@ func ConvertByteSize(value string, byteType string) (string, error) {
561561
return "", err
562562
}
563563

564-
if !(byteSize > 0 && byteSize <= 32) {
565-
return "", fmt.Errorf("Invalid size for type %s", byteType)
564+
if byteSize <= 0 || byteSize > 32 {
565+
return "", fmt.Errorf("invalid size for type %s", byteType)
566566
}
567567

568568
value = strings.TrimPrefix(value, "0x")
@@ -574,7 +574,7 @@ func ConvertByteSize(value string, byteType string) (string, error) {
574574
}
575575

576576
if len(value) != byteSize*2 {
577-
return "", fmt.Errorf("Invalid string length %s", value)
577+
return "", fmt.Errorf("invalid string length %s", value)
578578
}
579579

580580
paddedHex := rightPadWithZeros(value, 64)
@@ -601,7 +601,7 @@ func GetFunctionSignatureObject(functionSig string) (FunctionSignature, error) {
601601

602602
functionSigObject, err := FunctionSignatureParser.ParseString("", functionSig)
603603
if err != nil {
604-
return FunctionSignature{}, fmt.Errorf("Failed to parse function sig %s. Error: %v", functionSig, err)
604+
return FunctionSignature{}, fmt.Errorf("failed to parse function sig %s: %w", functionSig, err)
605605
}
606606

607607
return *functionSigObject, nil
@@ -612,7 +612,7 @@ func GetFunctionSignatureObject(functionSig string) (FunctionSignature, error) {
612612
// Input: "someFuncName(uint256,(string,string)[][],(uint256,(bool,string)))(uint,string)"
613613
// Returns: "someFuncName(uint256,(string,string)[][],(uint256,(bool,string)))"
614614
func ExtractFunctionNameAndFunctionArgs(input string) (string, error) {
615-
input = strings.Replace(input, " ", "", -1) // remove spaces per solidity doc: https://docs.soliditylang.org/en/latest/abi-spec.html#function-selector
615+
input = strings.ReplaceAll(input, " ", "") // remove spaces per solidity doc: https://docs.soliditylang.org/en/latest/abi-spec.html#function-selector
616616

617617
var depth int
618618
var endIndex int

abi/abi_test.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -193,17 +193,17 @@ func TestAbiEncode(t *testing.T) {
193193
"0x1234567",
194194
},
195195
},
196-
ErrMsg: "Invalid string length",
196+
ErrMsg: "invalid string length",
197197
},
198198
{
199-
Name: "Error: invalid bytes Encoding. Odd number of digits",
199+
Name: "Error: invalid bytes Encoding. odd number of digits",
200200
Input: AbiEncodeInput{
201201
FunctionSignature: "f(bytes)",
202202
FunctionInputs: []string{
203203
"0x1234567",
204204
},
205205
},
206-
ErrMsg: "Odd number of digits",
206+
ErrMsg: "odd number of digits",
207207
},
208208
{
209209
// cast calldata "f(string)(string)" "adfjkadhsffdhjksfdahjsfhadjsfasdhjfdsjlkfadshkjladfshjkadfskjladsfjkldfajhkdjafhkadsfjkldjksafjkhldsfhjksadflhj kldsafjklhadfsjkahlsdfkjlhasdfjkadfhslajkhsadfsjkl"
@@ -277,7 +277,7 @@ func TestAbiEncode(t *testing.T) {
277277
`[12,34,"yes"]`,
278278
},
279279
},
280-
ErrMsg: `Failed to convert`,
280+
ErrMsg: `failed to convert`,
281281
},
282282
{
283283
// cast calldata "f(uint256[][])" '[[12,34,567],[987,654,321,0],[99999999,99999]]'
@@ -319,7 +319,7 @@ func TestAbiEncode(t *testing.T) {
319319
`("matic",["123 street ave.","321 ave st."], 9999)`,
320320
},
321321
},
322-
ErrMsg: `Mismatched length of tuple elements`,
322+
ErrMsg: `mismatched length of tuple elements`,
323323
},
324324
{
325325
// cast calldata "getMultipliedAndAddNumber(uint256,bytes3,bool,string,address,int256[],string[],string[][],(string,uint256,bool[]))" 100000 "0x123456" true "abc" "0x6fda56c57b0acadb96ed5624ac500c0429d59429" "[1,2,3,4]" '["hi","bye","YOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOZ","test"]' '[["hi","bye","test"], ["hhhhh","byebye","bytebye","bytebyte"]]' '("yesyesyesyes", 369, [true,false,true])'

chainstore/passthrough_store.go

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -550,7 +550,11 @@ func (s *PassthroughStore) MeasureConnectionLatency(ctx context.Context) (time.D
550550
if err != nil {
551551
return 0, fmt.Errorf("failed to connect to %s: %w", address, err)
552552
}
553-
defer conn.Close()
553+
defer func() {
554+
if closeErr := conn.Close(); closeErr != nil {
555+
log.Debug().Err(closeErr).Msg("Failed to close latency measurement connection")
556+
}
557+
}()
554558

555559
latency := time.Since(start)
556560

@@ -608,7 +612,11 @@ func (s *PassthroughStore) GetSignature(ctx context.Context, hexSignature string
608612
if err != nil {
609613
return nil, fmt.Errorf("failed to fetch signature: %w", err)
610614
}
611-
defer resp.Body.Close()
615+
defer func() {
616+
if closeErr := resp.Body.Close(); closeErr != nil {
617+
log.Debug().Err(closeErr).Msg("Failed to close response body")
618+
}
619+
}()
612620

613621
if resp.StatusCode != http.StatusOK {
614622
body, _ := io.ReadAll(resp.Body)

cmd/dbbench/dbbench.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -305,7 +305,7 @@ func runFullScan(ctx context.Context, db KeyValueDB) (uint64, []uint64) {
305305
return opCount, buckets
306306
}
307307
func writeData(ctx context.Context, db KeyValueDB, startIndex, writeLimit uint64, sequential bool) {
308-
var i uint64 = startIndex
308+
var i = startIndex
309309
var wg sync.WaitGroup
310310
pool := make(chan bool, degreeOfParallelism)
311311
bar := getNewProgressBar(int64(writeLimit), "Writing data")

cmd/dbbench/pebbledb.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,14 +81,16 @@ func (w *WrappedPebbleIterator) Seek(key []byte) bool {
8181
func (w *WrappedPebbleIterator) SetReleaser(releaser util.Releaser) {
8282
}
8383
func (w *WrappedPebbleIterator) Release() {
84-
w.Iterator.Close()
84+
_ = w.Close()
8585
}
8686
func (p *PebbleDBWrapper) Get(key []byte) ([]byte, error) {
8787
resp, closer, err := p.handle.Get(key)
8888
if err != nil {
8989
return nil, err
9090
}
91-
closer.Close()
91+
if err := closer.Close(); err != nil {
92+
return nil, err
93+
}
9294
return resp, nil
9395
}
9496
func (p *PebbleDBWrapper) Put(key []byte, value []byte) error {

cmd/dockerlogger/dockerlogger.go

Lines changed: 27 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,11 @@ func dockerlogger(cmd *cobra.Command, args []string) error {
7171
if err != nil {
7272
return fmt.Errorf("error initializing Docker client: %v", err)
7373
}
74-
defer cli.Close()
74+
defer func() {
75+
if err := cli.Close(); err != nil {
76+
fmt.Printf("warning: failed to close Docker client: %v\n", err)
77+
}
78+
}()
7579

7680
// Monitor logs
7781
return monitorLogs(ctx, cli, dockerloggerInputArgs.network, &config)
@@ -177,14 +181,26 @@ func streamContainerLogs(ctx context.Context, cli *client.Client, containerID, c
177181
fmt.Printf("Error streaming logs for %s: %v\n", serviceName, err)
178182
return
179183
}
180-
defer logs.Close()
184+
defer func() {
185+
if err := logs.Close(); err != nil {
186+
fmt.Printf("warning: failed to close log stream for %s: %v\n", serviceName, err)
187+
}
188+
}()
181189

182190
fmt.Printf("Started monitoring container: %s\n", serviceName)
183191

184192
// Create a pipe to demultiplex Docker's stdout/stderr stream
185193
reader, writer := io.Pipe()
186-
defer reader.Close()
187-
defer writer.Close()
194+
defer func() {
195+
if err := reader.Close(); err != nil {
196+
fmt.Printf("warning: failed to close pipe reader for %s: %v\n", serviceName, err)
197+
}
198+
}()
199+
defer func() {
200+
if err := writer.Close(); err != nil {
201+
fmt.Printf("warning: failed to close pipe writer for %s: %v\n", serviceName, err)
202+
}
203+
}()
188204

189205
// Demultiplex the Docker log stream in a goroutine
190206
go func() {
@@ -193,7 +209,7 @@ func streamContainerLogs(ctx context.Context, cli *client.Client, containerID, c
193209
if err != nil && err != io.EOF {
194210
fmt.Printf("Error demultiplexing logs for %s: %v\n", serviceName, err)
195211
}
196-
writer.Close()
212+
_ = writer.Close()
197213
}()
198214

199215
// Read demultiplexed logs line by line
@@ -219,8 +235,8 @@ func streamContainerLogs(ctx context.Context, cli *client.Client, containerID, c
219235
timestamp := time.Now().UTC().Format("2006-01-02 15:04:05")
220236

221237
// Print with different colors for each component
222-
timestampColor.Printf("[%s] ", timestamp)
223-
serviceNameColor.Printf("[%s] ", serviceName)
238+
_, _ = timestampColor.Printf("[%s] ", timestamp)
239+
_, _ = serviceNameColor.Printf("[%s] ", serviceName)
224240

225241
// Colorize the log level within the message and print the rest normally
226242
printColorizedLogLine(logLine, logLineLower)
@@ -259,16 +275,16 @@ func printColorizedLogLine(logLine, logLineLower string) {
259275
if idx := strings.Index(logLineLower, patternLower); idx != -1 {
260276
// Print everything before the log level
261277
if idx > 0 {
262-
messageColor.Print(logLine[:idx])
278+
_, _ = messageColor.Print(logLine[:idx])
263279
}
264280

265281
// Print the log level with its color (preserve original case)
266282
levelEnd := idx + len(lp.pattern)
267-
lp.color.Print(logLine[idx:levelEnd])
283+
_, _ = lp.color.Print(logLine[idx:levelEnd])
268284

269285
// Print everything after the log level
270286
if levelEnd < len(logLine) {
271-
messageColor.Print(logLine[levelEnd:])
287+
_, _ = messageColor.Print(logLine[levelEnd:])
272288
}
273289
fmt.Println()
274290
foundLevel = true
@@ -278,7 +294,7 @@ func printColorizedLogLine(logLine, logLineLower string) {
278294

279295
// If no log level found, print the entire line normally
280296
if !foundLevel {
281-
messageColor.Println(logLine)
297+
_, _ = messageColor.Println(logLine)
282298
}
283299
}
284300

0 commit comments

Comments
 (0)