mirror of
https://github.com/shirou/gopsutil.git
synced 2025-04-24 13:48:56 +08:00
fix lint
This commit is contained in:
parent
3caf443966
commit
d725bd1786
@ -15,13 +15,15 @@ import (
|
||||
|
||||
var startBlank = regexp.MustCompile(`^\s+`)
|
||||
|
||||
var ignoreFSType = map[string]bool{"procfs": true}
|
||||
var FSType = map[int]string{
|
||||
0: "jfs2", 1: "namefs", 2: "nfs", 3: "jfs", 5: "cdrom", 6: "proc",
|
||||
16: "special-fs", 17: "cache-fs", 18: "nfs3", 19: "automount-fs", 20: "pool-fs", 32: "vxfs",
|
||||
33: "veritas-fs", 34: "udfs", 35: "nfs4", 36: "nfs4-pseudo", 37: "smbfs", 38: "mcr-pseudofs",
|
||||
39: "ahafs", 40: "sterm-nfs", 41: "asmfs",
|
||||
}
|
||||
var (
|
||||
ignoreFSType = map[string]bool{"procfs": true}
|
||||
FSType = map[int]string{
|
||||
0: "jfs2", 1: "namefs", 2: "nfs", 3: "jfs", 5: "cdrom", 6: "proc",
|
||||
16: "special-fs", 17: "cache-fs", 18: "nfs3", 19: "automount-fs", 20: "pool-fs", 32: "vxfs",
|
||||
33: "veritas-fs", 34: "udfs", 35: "nfs4", 36: "nfs4-pseudo", 37: "smbfs", 38: "mcr-pseudofs",
|
||||
39: "ahafs", 40: "sterm-nfs", 41: "asmfs",
|
||||
}
|
||||
)
|
||||
|
||||
func PartitionsWithContext(ctx context.Context, all bool) ([]PartitionStat, error) {
|
||||
var ret []PartitionStat
|
||||
|
@ -34,5 +34,7 @@ type Timeval struct {
|
||||
Usec int32
|
||||
}
|
||||
|
||||
type Diskstat struct{}
|
||||
type bintime struct{}
|
||||
type (
|
||||
Diskstat struct{}
|
||||
bintime struct{}
|
||||
)
|
||||
|
@ -33,5 +33,7 @@ type Timeval struct {
|
||||
Usec int64
|
||||
}
|
||||
|
||||
type Diskstat struct{}
|
||||
type bintime struct{}
|
||||
type (
|
||||
Diskstat struct{}
|
||||
bintime struct{}
|
||||
)
|
||||
|
@ -34,5 +34,7 @@ type Timeval struct {
|
||||
Usec int32
|
||||
}
|
||||
|
||||
type Diskstat struct{}
|
||||
type bintime struct{}
|
||||
type (
|
||||
Diskstat struct{}
|
||||
bintime struct{}
|
||||
)
|
||||
|
@ -34,5 +34,7 @@ type Timeval struct {
|
||||
Usec int64
|
||||
}
|
||||
|
||||
type Diskstat struct{}
|
||||
type bintime struct{}
|
||||
type (
|
||||
Diskstat struct{}
|
||||
bintime struct{}
|
||||
)
|
||||
|
@ -36,5 +36,7 @@ type (
|
||||
}
|
||||
)
|
||||
|
||||
type Diskstat struct{}
|
||||
type bintime struct{}
|
||||
type (
|
||||
Diskstat struct{}
|
||||
bintime struct{}
|
||||
)
|
||||
|
@ -26,7 +26,7 @@ func AvgWithContext(ctx context.Context) (*AvgStat, error) {
|
||||
}
|
||||
ret := &AvgStat{}
|
||||
|
||||
p := separator.Split(string(line[idx:len(line)]), 5)
|
||||
p := separator.Split(string(line[idx:]), 5)
|
||||
if 4 < len(p) && p[0] == "load" && p[1] == "average:" {
|
||||
if t, err := strconv.ParseFloat(p[2], 64); err == nil {
|
||||
ret.Load1 = t
|
||||
|
@ -18,7 +18,8 @@ import (
|
||||
var portMatch = regexp.MustCompile(`(.*)\.(\d+)$`)
|
||||
|
||||
func ParseNetstat(output string, mode string,
|
||||
iocs map[string]IOCountersStat) error {
|
||||
iocs map[string]IOCountersStat,
|
||||
) error {
|
||||
lines := strings.Split(output, "\n")
|
||||
|
||||
exists := make([]string, 0, len(lines)-1)
|
||||
|
@ -146,7 +146,6 @@ func getTemperatureFiles(ctx context.Context) ([]string, error) {
|
||||
}
|
||||
|
||||
return files, nil
|
||||
|
||||
}
|
||||
|
||||
func optionalValueReadFromFile(filename string) float64 {
|
||||
|
Loading…
x
Reference in New Issue
Block a user