diff --git a/disk/disk.go b/disk/disk.go index b2c9419..a2c4720 100644 --- a/disk/disk.go +++ b/disk/disk.go @@ -62,7 +62,3 @@ func (d IOCountersStat) String() string { s, _ := json.Marshal(d) return string(s) } - -func IOCounters() (map[string]IOCountersStat, error) { - return IOCountersForNames([]string{}) -} diff --git a/disk/disk_darwin_cgo.go b/disk/disk_darwin_cgo.go index 99b401d..2f5e22b 100644 --- a/disk/disk_darwin_cgo.go +++ b/disk/disk_darwin_cgo.go @@ -34,7 +34,7 @@ import ( "github.com/shirou/gopsutil/internal/common" ) -func IOCountersForNames(names []string) (map[string]IOCountersStat, error) { +func IOCounters(names ...string) (map[string]IOCountersStat, error) { if C.StartIOCounterFetch() == 0 { return nil, errors.New("Unable to fetch disk list") } diff --git a/disk/disk_darwin_nocgo.go b/disk/disk_darwin_nocgo.go index 40c4426..60fd7a6 100644 --- a/disk/disk_darwin_nocgo.go +++ b/disk/disk_darwin_nocgo.go @@ -5,6 +5,6 @@ package disk import "github.com/shirou/gopsutil/internal/common" -func IOCountersForNames(names []string) (map[string]IOCountersStat, error) { +func IOCounters(names ...string) (map[string]IOCountersStat, error) { return nil, common.ErrNotImplementedError } diff --git a/disk/disk_fallback.go b/disk/disk_fallback.go index 8bff71c..db52184 100644 --- a/disk/disk_fallback.go +++ b/disk/disk_fallback.go @@ -4,7 +4,7 @@ package disk import "github.com/shirou/gopsutil/internal/common" -func IOCountersForNames(names []string) (map[string]IOCountersStat, error) { +func IOCounters(names ...string) (map[string]IOCountersStat, error) { return nil, common.ErrNotImplementedError } diff --git a/disk/disk_freebsd.go b/disk/disk_freebsd.go index 7a84a2c..8569d14 100644 --- a/disk/disk_freebsd.go +++ b/disk/disk_freebsd.go @@ -94,7 +94,7 @@ func Partitions(all bool) ([]PartitionStat, error) { return ret, nil } -func IOCountersForNames(names []string) (map[string]IOCountersStat, error) { +func IOCounters(names ...string) (map[string]IOCountersStat, error) { // statinfo->devinfo->devstat // /usr/include/devinfo.h ret := make(map[string]IOCountersStat) diff --git a/disk/disk_linux.go b/disk/disk_linux.go index a50e66f..5595b76 100644 --- a/disk/disk_linux.go +++ b/disk/disk_linux.go @@ -272,7 +272,7 @@ func getFileSystems() ([]string, error) { return ret, nil } -func IOCountersForNames(names []string) (map[string]IOCountersStat, error) { +func IOCounters(names ...string) (map[string]IOCountersStat, error) { filename := common.HostProc("diskstats") lines, err := common.ReadLines(filename) if err != nil { diff --git a/disk/disk_openbsd.go b/disk/disk_openbsd.go index b836fa3..28866df 100644 --- a/disk/disk_openbsd.go +++ b/disk/disk_openbsd.go @@ -63,7 +63,7 @@ func Partitions(all bool) ([]PartitionStat, error) { return ret, nil } -func IOCountersForNames(names []string) (map[string]IOCountersStat, error) { +func IOCounters(names ...string) (map[string]IOCountersStat, error) { ret := make(map[string]IOCountersStat) r, err := syscall.Sysctl("hw.diskstats") diff --git a/disk/disk_windows.go b/disk/disk_windows.go index af89e5c..ca16a4a 100644 --- a/disk/disk_windows.go +++ b/disk/disk_windows.go @@ -129,7 +129,7 @@ func Partitions(all bool) ([]PartitionStat, error) { return ret, nil } -func IOCountersForNames(names []string) (map[string]IOCountersStat, error) { +func IOCounters(names ...string) (map[string]IOCountersStat, error) { ret := make(map[string]IOCountersStat, 0) var dst []Win32_PerfFormattedData