Skip to content

Commit cf428f8

Browse files
authored
Merge pull request #1443 from mmorel-35/linter
ci(lint): correct gci linter
2 parents 755bcab + 1fb1e3e commit cf428f8

File tree

11 files changed

+30
-11
lines changed

11 files changed

+30
-11
lines changed

.golangci.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,3 +46,10 @@ linters:
4646
- structcheck
4747
- unused
4848
- varcheck
49+
50+
linters-settings:
51+
gci:
52+
sections:
53+
- standard
54+
- default
55+
- prefix(github.com/shirou)

cpu/cpu_linux.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,9 @@ import (
1111
"strconv"
1212
"strings"
1313

14-
"github.com/shirou/gopsutil/v3/internal/common"
1514
"github.com/tklauser/go-sysconf"
15+
16+
"github.com/shirou/gopsutil/v3/internal/common"
1617
)
1718

1819
var ClocksPerSec = float64(100)

cpu/cpu_test.go

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

11-
"github.com/shirou/gopsutil/v3/internal/common"
1211
"github.com/stretchr/testify/assert"
12+
13+
"github.com/shirou/gopsutil/v3/internal/common"
1314
)
1415

1516
func skipIfNotImplementedErr(t *testing.T, err error) {

disk/disk_linux.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,9 @@ import (
1616
"strconv"
1717
"strings"
1818

19-
"github.com/shirou/gopsutil/v3/internal/common"
2019
"golang.org/x/sys/unix"
20+
21+
"github.com/shirou/gopsutil/v3/internal/common"
2122
)
2223

2324
const (

host/host_linux.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,9 @@ import (
1515
"strconv"
1616
"strings"
1717

18-
"github.com/shirou/gopsutil/v3/internal/common"
1918
"golang.org/x/sys/unix"
19+
20+
"github.com/shirou/gopsutil/v3/internal/common"
2021
)
2122

2223
type lsbStruct struct {

mem/mem_linux.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,9 @@ import (
1414
"strconv"
1515
"strings"
1616

17-
"github.com/shirou/gopsutil/v3/internal/common"
1817
"golang.org/x/sys/unix"
18+
19+
"github.com/shirou/gopsutil/v3/internal/common"
1920
)
2021

2122
type VirtualMemoryExStat struct {

mem/mem_test.go

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

9-
"github.com/shirou/gopsutil/v3/internal/common"
109
"github.com/stretchr/testify/assert"
10+
11+
"github.com/shirou/gopsutil/v3/internal/common"
1112
)
1213

1314
func skipIfNotImplementedErr(t *testing.T, err error) {

net/net_linux_test.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,9 @@ import (
99
"syscall"
1010
"testing"
1111

12-
"github.com/shirou/gopsutil/v3/internal/common"
1312
"github.com/stretchr/testify/assert"
13+
14+
"github.com/shirou/gopsutil/v3/internal/common"
1415
)
1516

1617
func TestIOCountersByFileParsing(t *testing.T) {
@@ -248,6 +249,7 @@ entries searched found new invalid ignore delete deleteList insert insertFailed
248249

249250
// Function under test
250251
stats, err := conntrackStatsFromFile(tmpfile.Name(), true)
252+
assert.Nil(t, err)
251253
assert.Equal(t, 8, len(stats), "Expected 8 results")
252254

253255
summary := &ConntrackStat{}
@@ -308,6 +310,7 @@ entries searched found new invalid ignore delete deleteList insert insertFailed
308310

309311
// Test summary grouping
310312
totals, err := conntrackStatsFromFile(tmpfile.Name(), false)
313+
assert.Nil(t, err)
311314
for i, st := range totals {
312315
assert.Equal(t, summary.Entries, st.Entries)
313316
assert.Equal(t, summary.Searched, st.Searched)

process/process_linux.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,12 @@ import (
1616
"strconv"
1717
"strings"
1818

19+
"github.com/tklauser/go-sysconf"
20+
"golang.org/x/sys/unix"
21+
1922
"github.com/shirou/gopsutil/v3/cpu"
2023
"github.com/shirou/gopsutil/v3/internal/common"
2124
"github.com/shirou/gopsutil/v3/net"
22-
"github.com/tklauser/go-sysconf"
23-
"golang.org/x/sys/unix"
2425
)
2526

2627
var pageSize = uint64(os.Getpagesize())

process/process_posix.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,9 @@ import (
1414
"strings"
1515
"syscall"
1616

17-
"github.com/shirou/gopsutil/v3/internal/common"
1817
"golang.org/x/sys/unix"
18+
19+
"github.com/shirou/gopsutil/v3/internal/common"
1920
)
2021

2122
type Signal = syscall.Signal

process/process_test.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,9 @@ import (
1717
"testing"
1818
"time"
1919

20-
"github.com/shirou/gopsutil/v3/internal/common"
2120
"github.com/stretchr/testify/assert"
21+
22+
"github.com/shirou/gopsutil/v3/internal/common"
2223
)
2324

2425
var mu sync.Mutex

0 commit comments

Comments
 (0)