Skip to content

Commit 8a57865

Browse files
authored
chore: update Go version in go.mod (#137)
* chore: update Go version in go.mod Signed-off-by: Gaius <gaius.qi@gmail.com> * chore(golangci): update linters configuration Signed-off-by: Gaius <gaius.qi@gmail.com> * style(stats): update table header method for clarity Signed-off-by: Gaius <gaius.qi@gmail.com> --------- Signed-off-by: Gaius <gaius.qi@gmail.com>
1 parent 1f8cffd commit 8a57865

File tree

4 files changed

+49
-33
lines changed

4 files changed

+49
-33
lines changed

.github/workflows/lint.yaml

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,6 @@ on:
66
pull_request:
77
branches: [ main ]
88

9-
env:
10-
GO_VERSION: '1.20'
11-
129
jobs:
1310
lint:
1411
name: Lint
@@ -21,10 +18,9 @@ jobs:
2118
fetch-depth: '0'
2219

2320
- name: Golangci lint
24-
uses: golangci/golangci-lint-action@4696ba8babb6127d732c3c6dde519db15edab9ea
21+
uses: golangci/golangci-lint-action@1e7e51e771db61008b38414a730f564565cf7c20
2522
with:
26-
version: v1.54
27-
args: --verbose
23+
version: v2.7
2824

2925
- name: Markdown lint
3026
uses: docker://avtodev/markdown-lint:v1

.golangci.yml

Lines changed: 45 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,53 @@
1+
version: "2"
12
run:
23
modules-download-mode: readonly
3-
4-
linters-settings:
5-
gocyclo:
6-
min-complexity: 100
7-
8-
issues:
9-
new: true
10-
exclude-rules:
11-
- linters:
12-
- staticcheck
13-
text: "SA1019:"
14-
154
linters:
16-
disable-all: true
5+
default: none
176
enable:
18-
- gci
19-
- gofmt
20-
- golint
21-
- misspell
22-
- govet
7+
- errcheck
238
- goconst
24-
- deadcode
259
- gocyclo
10+
- govet
11+
- misspell
2612
- staticcheck
27-
- errcheck
28-
13+
settings:
14+
gocyclo:
15+
min-complexity: 60
16+
exclusions:
17+
generated: lax
18+
presets:
19+
- comments
20+
- common-false-positives
21+
- legacy
22+
- std-error-handling
23+
rules:
24+
- linters:
25+
- staticcheck
26+
text: 'SA1019:'
27+
paths:
28+
- third_party$
29+
- builtin$
30+
- examples$
31+
issues:
32+
new: true
33+
formatters:
34+
enable:
35+
- gci
36+
- gofmt
37+
settings:
38+
gci:
39+
sections:
40+
- standard
41+
- default
42+
exclusions:
43+
generated: lax
44+
paths:
45+
- third_party$
46+
- builtin$
47+
- examples$
2948
output:
30-
print-issued-lines: true
31-
print-linter-name: true
49+
formats:
50+
text:
51+
path: stdout
52+
print-linter-name: true
53+
print-issued-lines: true

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
module github.com/dragonflyoss/perf-tests
22

3-
go 1.24.0
3+
go 1.25.5
44

55
require (
66
github.com/dustin/go-humanize v1.0.1

pkg/stats/stats.go

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,7 @@ func (s *stats) PrettyPrint() error {
221221
// printTable prints the download statistics in a table format.
222222
func printTable(downloads map[backend.FileSizeLevel][]*Download) error {
223223
table := tablewriter.NewWriter(os.Stdout)
224-
table.SetHeader([]string{"File Size Level", "Times", "Min Cost", "Max Cost", "Avg Cost", "Back To Source Traffic", "Remote Peer Traffic", "Local Peer Traffic", "Back To Source Rate"})
224+
table.Header([]string{"File Size Level", "Times", "Min Cost", "Max Cost", "Avg Cost", "Back To Source Traffic", "Remote Peer Traffic", "Local Peer Traffic", "Back To Source Rate"})
225225

226226
rows := map[backend.FileSizeLevel][]string{}
227227
for fileSizeLevel, records := range downloads {
@@ -301,8 +301,6 @@ func printTable(downloads map[backend.FileSizeLevel][]*Download) error {
301301
}
302302
}
303303

304-
table.SetAlignment(tablewriter.ALIGN_LEFT)
305-
table.SetRowLine(true)
306304
table.Render()
307305
return nil
308306
}

0 commit comments

Comments
 (0)