diff --git a/disk/disk_aix_nocgo.go b/disk/disk_aix_nocgo.go index 58f32defc..e8ad5dee4 100644 --- a/disk/disk_aix_nocgo.go +++ b/disk/disk_aix_nocgo.go @@ -14,13 +14,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 diff --git a/disk/disk_openbsd_386.go b/disk/disk_openbsd_386.go index 919b8949b..66e1795b5 100644 --- a/disk/disk_openbsd_386.go +++ b/disk/disk_openbsd_386.go @@ -34,5 +34,7 @@ type Timeval struct { Usec int32 } -type Diskstat struct{} -type bintime struct{} +type ( + Diskstat struct{} + bintime struct{} +) diff --git a/disk/disk_openbsd_amd64.go b/disk/disk_openbsd_amd64.go index ca8fb8222..9070ff0d6 100644 --- a/disk/disk_openbsd_amd64.go +++ b/disk/disk_openbsd_amd64.go @@ -33,5 +33,7 @@ type Timeval struct { Usec int64 } -type Diskstat struct{} -type bintime struct{} +type ( + Diskstat struct{} + bintime struct{} +) diff --git a/disk/disk_openbsd_arm.go b/disk/disk_openbsd_arm.go index b9821d922..f23a293db 100644 --- a/disk/disk_openbsd_arm.go +++ b/disk/disk_openbsd_arm.go @@ -34,5 +34,7 @@ type Timeval struct { Usec int32 } -type Diskstat struct{} -type bintime struct{} +type ( + Diskstat struct{} + bintime struct{} +) diff --git a/disk/disk_openbsd_arm64.go b/disk/disk_openbsd_arm64.go index 1cde02f25..465296e79 100644 --- a/disk/disk_openbsd_arm64.go +++ b/disk/disk_openbsd_arm64.go @@ -34,5 +34,7 @@ type Timeval struct { Usec int64 } -type Diskstat struct{} -type bintime struct{} +type ( + Diskstat struct{} + bintime struct{} +) diff --git a/disk/disk_openbsd_riscv64.go b/disk/disk_openbsd_riscv64.go index 9129851d7..3620c1662 100644 --- a/disk/disk_openbsd_riscv64.go +++ b/disk/disk_openbsd_riscv64.go @@ -36,5 +36,7 @@ type ( } ) -type Diskstat struct{} -type bintime struct{} +type ( + Diskstat struct{} + bintime struct{} +) diff --git a/load/load_aix_nocgo.go b/load/load_aix_nocgo.go index fed8fc21b..cfb4117d6 100644 --- a/load/load_aix_nocgo.go +++ b/load/load_aix_nocgo.go @@ -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 diff --git a/net/net_openbsd.go b/net/net_openbsd.go index 16d4fa474..b6c31dd35 100644 --- a/net/net_openbsd.go +++ b/net/net_openbsd.go @@ -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) diff --git a/sensors/sensors_linux.go b/sensors/sensors_linux.go index 0e28ac044..6899d2dcc 100644 --- a/sensors/sensors_linux.go +++ b/sensors/sensors_linux.go @@ -146,7 +146,6 @@ func getTemperatureFiles(ctx context.Context) ([]string, error) { } return files, nil - } func optionalValueReadFromFile(filename string) float64 {