Skip to content

Commit 7d2bf14

Browse files
authored
Merge pull request #6 from stringintech/update-linter
Update linter CI and fix lint errors.
2 parents 47a346c + 2f7f07d commit 7d2bf14

File tree

5 files changed

+22
-6
lines changed

5 files changed

+22
-6
lines changed

.github/workflows/ci.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,6 @@ jobs:
106106
go-version: '1.23.3'
107107

108108
- name: Run linter
109-
uses: golangci/golangci-lint-action@v4
109+
uses: golangci/golangci-lint-action@v9
110110
with:
111-
version: latest
111+
version: v2.6.1

.golangci.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
version: "2"
2+
3+
run:
4+
timeout: 5m
5+
tests: true
6+
7+
linters:
8+
default: standard
9+
settings:
10+
govet:
11+
disable:
12+
- unsafeptr

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ lint:
3939
golangci-lint run ./...
4040

4141
deps:
42-
go install github.com/golangci/golangci-lint/cmd/golangci-lint@latest
42+
go install github.com/golangci/golangci-lint/v2/cmd/golangci-lint@v2.6.1
4343

4444
update-kernel:
4545
git subtree pull --prefix=depend/bitcoin https://github.com/bitcoin/bitcoin.git master --squash

kernel/chainstate_manager_test.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,11 @@ func (s *ChainstateManagerTestSuite) Setup(t *testing.T) {
143143
if err != nil {
144144
t.Fatalf("Failed to create temp dir: %v", err)
145145
}
146-
t.Cleanup(func() { os.RemoveAll(tempDir) })
146+
t.Cleanup(func() {
147+
if err := os.RemoveAll(tempDir); err != nil {
148+
t.Errorf("Failed to remove temp dir: %v", err)
149+
}
150+
})
147151

148152
dataDir := filepath.Join(tempDir, "data")
149153
blocksDir := filepath.Join(tempDir, "blocks")

kernel/context.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ func NewContext(options *ContextOptions) (*Context, error) {
5353
//
5454
// Returns an error if the interrupt signal cannot be delivered.
5555
func (ctx *Context) Interrupt() error {
56-
result := C.btck_context_interrupt((*C.btck_Context)(ctx.handle.ptr))
56+
result := C.btck_context_interrupt((*C.btck_Context)(ctx.ptr))
5757
if result != 0 {
5858
return &InternalError{"Context interrupt failed"}
5959
}
@@ -65,5 +65,5 @@ func (ctx *Context) Interrupt() error {
6565
// The context is reference-counted internally, so this operation is efficient and does
6666
// not duplicate the underlying data.
6767
func (ctx *Context) Copy() *Context {
68-
return newContext((*C.btck_Context)(ctx.handle.ptr), false)
68+
return newContext((*C.btck_Context)(ctx.ptr), false)
6969
}

0 commit comments

Comments
 (0)