mirror of
https://github.com/shirou/gopsutil.git
synced 2025-05-08 19:29:25 +08:00
Merge pull request #1443 from mmorel-35/linter
ci(lint): correct gci linter
This commit is contained in:
commit
cf428f8c72
@ -46,3 +46,10 @@ linters:
|
||||
- structcheck
|
||||
- unused
|
||||
- varcheck
|
||||
|
||||
linters-settings:
|
||||
gci:
|
||||
sections:
|
||||
- standard
|
||||
- default
|
||||
- prefix(github.com/shirou)
|
||||
|
@ -11,8 +11,9 @@ import (
|
||||
"strconv"
|
||||
"strings"
|
||||
|
||||
"github.com/shirou/gopsutil/v3/internal/common"
|
||||
"github.com/tklauser/go-sysconf"
|
||||
|
||||
"github.com/shirou/gopsutil/v3/internal/common"
|
||||
)
|
||||
|
||||
var ClocksPerSec = float64(100)
|
||||
|
@ -8,8 +8,9 @@ import (
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
"github.com/shirou/gopsutil/v3/internal/common"
|
||||
"github.com/stretchr/testify/assert"
|
||||
|
||||
"github.com/shirou/gopsutil/v3/internal/common"
|
||||
)
|
||||
|
||||
func skipIfNotImplementedErr(t *testing.T, err error) {
|
||||
|
@ -16,8 +16,9 @@ import (
|
||||
"strconv"
|
||||
"strings"
|
||||
|
||||
"github.com/shirou/gopsutil/v3/internal/common"
|
||||
"golang.org/x/sys/unix"
|
||||
|
||||
"github.com/shirou/gopsutil/v3/internal/common"
|
||||
)
|
||||
|
||||
const (
|
||||
|
@ -15,8 +15,9 @@ import (
|
||||
"strconv"
|
||||
"strings"
|
||||
|
||||
"github.com/shirou/gopsutil/v3/internal/common"
|
||||
"golang.org/x/sys/unix"
|
||||
|
||||
"github.com/shirou/gopsutil/v3/internal/common"
|
||||
)
|
||||
|
||||
type lsbStruct struct {
|
||||
|
@ -14,8 +14,9 @@ import (
|
||||
"strconv"
|
||||
"strings"
|
||||
|
||||
"github.com/shirou/gopsutil/v3/internal/common"
|
||||
"golang.org/x/sys/unix"
|
||||
|
||||
"github.com/shirou/gopsutil/v3/internal/common"
|
||||
)
|
||||
|
||||
type VirtualMemoryExStat struct {
|
||||
|
@ -6,8 +6,9 @@ import (
|
||||
"runtime"
|
||||
"testing"
|
||||
|
||||
"github.com/shirou/gopsutil/v3/internal/common"
|
||||
"github.com/stretchr/testify/assert"
|
||||
|
||||
"github.com/shirou/gopsutil/v3/internal/common"
|
||||
)
|
||||
|
||||
func skipIfNotImplementedErr(t *testing.T, err error) {
|
||||
|
@ -9,8 +9,9 @@ import (
|
||||
"syscall"
|
||||
"testing"
|
||||
|
||||
"github.com/shirou/gopsutil/v3/internal/common"
|
||||
"github.com/stretchr/testify/assert"
|
||||
|
||||
"github.com/shirou/gopsutil/v3/internal/common"
|
||||
)
|
||||
|
||||
func TestIOCountersByFileParsing(t *testing.T) {
|
||||
@ -248,6 +249,7 @@ entries searched found new invalid ignore delete deleteList insert insertFailed
|
||||
|
||||
// Function under test
|
||||
stats, err := conntrackStatsFromFile(tmpfile.Name(), true)
|
||||
assert.Nil(t, err)
|
||||
assert.Equal(t, 8, len(stats), "Expected 8 results")
|
||||
|
||||
summary := &ConntrackStat{}
|
||||
@ -308,6 +310,7 @@ entries searched found new invalid ignore delete deleteList insert insertFailed
|
||||
|
||||
// Test summary grouping
|
||||
totals, err := conntrackStatsFromFile(tmpfile.Name(), false)
|
||||
assert.Nil(t, err)
|
||||
for i, st := range totals {
|
||||
assert.Equal(t, summary.Entries, st.Entries)
|
||||
assert.Equal(t, summary.Searched, st.Searched)
|
||||
|
@ -16,11 +16,12 @@ import (
|
||||
"strconv"
|
||||
"strings"
|
||||
|
||||
"github.com/tklauser/go-sysconf"
|
||||
"golang.org/x/sys/unix"
|
||||
|
||||
"github.com/shirou/gopsutil/v3/cpu"
|
||||
"github.com/shirou/gopsutil/v3/internal/common"
|
||||
"github.com/shirou/gopsutil/v3/net"
|
||||
"github.com/tklauser/go-sysconf"
|
||||
"golang.org/x/sys/unix"
|
||||
)
|
||||
|
||||
var pageSize = uint64(os.Getpagesize())
|
||||
|
@ -14,8 +14,9 @@ import (
|
||||
"strings"
|
||||
"syscall"
|
||||
|
||||
"github.com/shirou/gopsutil/v3/internal/common"
|
||||
"golang.org/x/sys/unix"
|
||||
|
||||
"github.com/shirou/gopsutil/v3/internal/common"
|
||||
)
|
||||
|
||||
type Signal = syscall.Signal
|
||||
|
@ -17,8 +17,9 @@ import (
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
"github.com/shirou/gopsutil/v3/internal/common"
|
||||
"github.com/stretchr/testify/assert"
|
||||
|
||||
"github.com/shirou/gopsutil/v3/internal/common"
|
||||
)
|
||||
|
||||
var mu sync.Mutex
|
||||
|
Loading…
x
Reference in New Issue
Block a user