Skip to content

Commit ef2e86b

Browse files
authored
Merge pull request #184 from nspcc-dev/new-golangci
2 parents 9224595 + b483ae7 commit ef2e86b

File tree

6 files changed

+14
-94
lines changed

6 files changed

+14
-94
lines changed

.github/workflows/tests.yml

Lines changed: 3 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -18,24 +18,9 @@ on:
1818

1919
jobs:
2020
lint:
21-
name: Lint
22-
runs-on: ubuntu-latest
23-
24-
steps:
25-
- uses: actions/checkout@v4
26-
with:
27-
ref: ${{ github.event.inputs.ref }}
28-
29-
- uses: actions/setup-go@v5
30-
with:
31-
go-version-file: 'cmd/go.mod'
32-
cache-dependency-path: cmd/go.sum
33-
34-
- name: golangci-lint
35-
uses: golangci/golangci-lint-action@v4
36-
with:
37-
version: latest
38-
working-directory: cmd
21+
uses: nspcc-dev/.github/.github/workflows/go-linter.yml@master
22+
with:
23+
workdir: cmd
3924

4025
codeql:
4126
name: CodeQL

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
.idea
22
.vscode
3+
.golangci.yml
34
vendor
45
.docker/ir/out/*
56
!.docker/ir/out/.gitkeep

.golangci.yml

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

Makefile

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ NEOBENCH_FROM_COUNT ?= 1
1212
NEOBENCH_TO_COUNT ?= 1
1313
MS_PER_BLOCK ?= 0
1414

15-
.PHONY: help
15+
.PHONY: help lint
1616

1717
# Show this help prompt
1818
help:
@@ -36,6 +36,13 @@ help:
3636
start.SharpFourNodesGoRPC10wrk start.SharpFourNodesGoRPC30wrk start.SharpFourNodesGoRPC100wrk \
3737
start.SharpFourNodesGoRPC25rate start.SharpFourNodesGoRPC50rate start.SharpFourNodesGoRPC60rate start.SharpFourNodesGoRPC300rate start.SharpFourNodesGoRPC1000rate
3838

39+
.golangci.yml:
40+
wget -O $@ https://github.com/nspcc-dev/.github/raw/master/.golangci.yml
41+
42+
# Lint Go code
43+
lint: .golangci.yml
44+
@cd cmd && golangci-lint run --config ../$<
45+
3946
# Build all images
4047
build: gen build.node.bench build.node.go build.node.sharp build.bench
4148

cmd/config/main.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@ func generateSharpConfig(templatePath, storageEngine, suffix string) error {
190190
return nil
191191
}
192192

193-
func writeJSON(path string, obj interface{}) error {
193+
func writeJSON(path string, obj any) error {
194194
bytes, err := json.Marshal(obj)
195195
if err != nil {
196196
return err

cmd/internal/client.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ func (c *RPCClient) GetBlockCount(ctx context.Context) (int, error) {
166166
return num, c.doRPCCall(ctx, rpc, &num, c.blockRequester)
167167
}
168168

169-
func (c *RPCClient) doRPCCall(_ context.Context, call string, result interface{}, client *fasthttp.Client) error {
169+
func (c *RPCClient) doRPCCall(_ context.Context, call string, result any, client *fasthttp.Client) error {
170170
idx := c.inc.Add(1) % c.len
171171

172172
req, res := fasthttp.AcquireRequest(), fasthttp.AcquireResponse()

0 commit comments

Comments
 (0)