Skip to content

Commit 092ee98

Browse files
authored
Merge pull request #993 from Elbehery/20250615_add_goimport_golangci-lint
chore(CI): add goimports to linter
2 parents 6a1dfa5 + 55e2494 commit 092ee98

File tree

14 files changed

+42
-14
lines changed

14 files changed

+42
-14
lines changed

.github/workflows/failpoint_test.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,10 @@ jobs:
1515
- uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5.5.0
1616
with:
1717
go-version: ${{ steps.goversion.outputs.goversion }}
18+
- name: Run golangci-lint
19+
uses: golangci/golangci-lint-action@4afd733a84b1f43292c63897423277bb7f4313a9 # v8.0.0
20+
with:
21+
version: v2.1.6
1822
- run: |
1923
make gofail-enable
2024
make test-failpoint

.github/workflows/robustness_template.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,10 @@ jobs:
2929
- uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5.5.0
3030
with:
3131
go-version: ${{ steps.goversion.outputs.goversion }}
32+
- name: Run golangci-lint
33+
uses: golangci/golangci-lint-action@4afd733a84b1f43292c63897423277bb7f4313a9 # v8.0.0
34+
with:
35+
version: v2.1.6
3236
- name: test-robustness
3337
run: |
3438
set -euo pipefail

.github/workflows/tests-template.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ jobs:
4949
exit 1
5050
;;
5151
esac
52-
- name: golangci-lint
52+
- name: Run golangci-lint
5353
uses: golangci/golangci-lint-action@4afd733a84b1f43292c63897423277bb7f4313a9 # v8.0.0
5454
with:
5555
version: v2.1.6

.github/workflows/tests_amd64.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,4 +23,8 @@ jobs:
2323
- uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5.5.0
2424
with:
2525
go-version: ${{ steps.goversion.outputs.goversion }}
26+
- name: Run golangci-lint
27+
uses: golangci/golangci-lint-action@4afd733a84b1f43292c63897423277bb7f4313a9 # v8.0.0
28+
with:
29+
version: v2.1.6
2630
- run: make coverage

.github/workflows/tests_arm64.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,4 +25,8 @@ jobs:
2525
- uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5.5.0
2626
with:
2727
go-version: ${{ steps.goversion.outputs.goversion }}
28+
- name: Run golangci-lint
29+
uses: golangci/golangci-lint-action@4afd733a84b1f43292c63897423277bb7f4313a9 # v8.0.0
30+
with:
31+
version: v2.1.6
2832
- run: make coverage

.github/workflows/tests_windows.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ jobs:
3939
;;
4040
esac
4141
shell: bash
42-
- name: golangci-lint
42+
- name: Run golangci-lint
4343
uses: golangci/golangci-lint-action@4afd733a84b1f43292c63897423277bb7f4313a9 # v8.0.0
4444
with:
4545
version: v2.1.6
@@ -54,4 +54,8 @@ jobs:
5454
- uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5.5.0
5555
with:
5656
go-version: ${{ steps.goversion.outputs.goversion }}
57+
- name: Run golangci-lint
58+
uses: golangci/golangci-lint-action@4afd733a84b1f43292c63897423277bb7f4313a9 # v8.0.0
59+
with:
60+
version: v2.1.6
5761
- run: make coverage

.golangci.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,14 @@
11
formatters:
22
enable:
3+
- gci
34
- gofmt
45
- goimports
56
settings: # please keep this alphabetized
7+
gci:
8+
sections:
9+
- standard
10+
- default
11+
- prefix(go.etcd.io)
612
goimports:
713
local-prefixes:
814
- go.etcd.io # Put imports beginning with prefix after 3rd-party packages.

bolt_aix.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,9 @@ import (
88
"time"
99
"unsafe"
1010

11-
"go.etcd.io/bbolt/internal/common"
1211
"golang.org/x/sys/unix"
12+
13+
"go.etcd.io/bbolt/internal/common"
1314
)
1415

1516
// flock acquires an advisory lock on a file descriptor.

bolt_android.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,9 @@ import (
66
"time"
77
"unsafe"
88

9-
"go.etcd.io/bbolt/internal/common"
109
"golang.org/x/sys/unix"
10+
11+
"go.etcd.io/bbolt/internal/common"
1112
)
1213

1314
// flock acquires an advisory lock on a file descriptor.

bolt_solaris.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,9 @@ import (
66
"time"
77
"unsafe"
88

9-
"go.etcd.io/bbolt/internal/common"
109
"golang.org/x/sys/unix"
10+
11+
"go.etcd.io/bbolt/internal/common"
1112
)
1213

1314
// flock acquires an advisory lock on a file descriptor.

0 commit comments

Comments
 (0)