From 252e4c2e71591163703393228a43fc1a405fa3d0 Mon Sep 17 00:00:00 2001 From: Jaime Soriano Pastor Date: Sun, 1 Jul 2018 21:51:41 +0200 Subject: [PATCH] Update gopsutil to 2.18.06 --- NOTICE.txt | 4 +- .../github.com/shirou/gopsutil/disk/disk.go | 7 +-- .../shirou/gopsutil/disk/disk_darwin.go | 12 ++-- .../shirou/gopsutil/disk/disk_darwin_386.go | 59 ++++++++++++++++++ .../shirou/gopsutil/disk/disk_darwin_amd64.go | 2 +- .../shirou/gopsutil/disk/disk_darwin_arm64.go | 2 +- .../shirou/gopsutil/disk/disk_freebsd.go | 4 +- .../shirou/gopsutil/disk/disk_linux.go | 61 ++++++++++++++----- .../shirou/gopsutil/disk/disk_openbsd.go | 4 +- .../shirou/gopsutil/disk/disk_windows.go | 2 - .../shirou/gopsutil/internal/common/common.go | 12 +++- .../gopsutil/internal/common/common_darwin.go | 5 +- .../gopsutil/internal/common/common_unix.go | 9 +-- .../internal/common/common_windows.go | 6 ++ vendor/github.com/shirou/gopsutil/net/net.go | 6 +- .../shirou/gopsutil/net/net_darwin.go | 6 +- .../shirou/gopsutil/net/net_freebsd.go | 2 +- .../shirou/gopsutil/net/net_openbsd.go | 6 +- .../shirou/gopsutil/net/net_unix.go | 2 +- vendor/vendor.json | 40 +++++++----- 20 files changed, 181 insertions(+), 70 deletions(-) create mode 100644 vendor/github.com/shirou/gopsutil/disk/disk_darwin_386.go diff --git a/NOTICE.txt b/NOTICE.txt index dd17d4e44e8..79c399c92a3 100644 --- a/NOTICE.txt +++ b/NOTICE.txt @@ -1963,8 +1963,8 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -------------------------------------------------------------------- Dependency: github.com/shirou/gopsutil -Version: v2.18.01 -Revision: c432be29ccce470088d07eea25b3ea7e68a8afbb +Version: v2.18.06 +Revision: 4a180b209f5f494e5923cfce81ea30ba23915877 License type (autodetected): BSD-3-Clause ./vendor/github.com/shirou/gopsutil/LICENSE: -------------------------------------------------------------------- diff --git a/vendor/github.com/shirou/gopsutil/disk/disk.go b/vendor/github.com/shirou/gopsutil/disk/disk.go index a2c47204d75..38d8a8f16d8 100644 --- a/vendor/github.com/shirou/gopsutil/disk/disk.go +++ b/vendor/github.com/shirou/gopsutil/disk/disk.go @@ -6,11 +6,7 @@ import ( "github.com/shirou/gopsutil/internal/common" ) -var invoke common.Invoker - -func init() { - invoke = common.Invoke{} -} +var invoke common.Invoker = common.Invoke{} type UsageStat struct { Path string `json:"path"` @@ -46,6 +42,7 @@ type IOCountersStat struct { WeightedIO uint64 `json:"weightedIO"` Name string `json:"name"` SerialNumber string `json:"serialNumber"` + Label string `json:"label"` } func (d UsageStat) String() string { diff --git a/vendor/github.com/shirou/gopsutil/disk/disk_darwin.go b/vendor/github.com/shirou/gopsutil/disk/disk_darwin.go index 82ffacbd0a1..2b1d000db3e 100644 --- a/vendor/github.com/shirou/gopsutil/disk/disk_darwin.go +++ b/vendor/github.com/shirou/gopsutil/disk/disk_darwin.go @@ -22,8 +22,10 @@ func PartitionsWithContext(ctx context.Context, all bool) ([]PartitionStat, erro if err != nil { return ret, err } - fs := make([]Statfs_t, count) - _, err = Getfsstat(fs, MntWait) + fs := make([]Statfs, count) + if _, err = Getfsstat(fs, MntWait); err != nil { + return ret, err + } for _, stat := range fs { opts := "rw" if stat.Flags&MntReadOnly != 0 { @@ -92,16 +94,16 @@ func PartitionsWithContext(ctx context.Context, all bool) ([]PartitionStat, erro return ret, nil } -func Getfsstat(buf []Statfs_t, flags int) (n int, err error) { +func Getfsstat(buf []Statfs, flags int) (n int, err error) { return GetfsstatWithContext(context.Background(), buf, flags) } -func GetfsstatWithContext(ctx context.Context, buf []Statfs_t, flags int) (n int, err error) { +func GetfsstatWithContext(ctx context.Context, buf []Statfs, flags int) (n int, err error) { var _p0 unsafe.Pointer var bufsize uintptr if len(buf) > 0 { _p0 = unsafe.Pointer(&buf[0]) - bufsize = unsafe.Sizeof(Statfs_t{}) * uintptr(len(buf)) + bufsize = unsafe.Sizeof(Statfs{}) * uintptr(len(buf)) } r0, _, e1 := unix.Syscall(SYS_GETFSSTAT64, uintptr(_p0), bufsize, uintptr(flags)) n = int(r0) diff --git a/vendor/github.com/shirou/gopsutil/disk/disk_darwin_386.go b/vendor/github.com/shirou/gopsutil/disk/disk_darwin_386.go new file mode 100644 index 00000000000..bd83a4a712b --- /dev/null +++ b/vendor/github.com/shirou/gopsutil/disk/disk_darwin_386.go @@ -0,0 +1,59 @@ +// +build darwin +// +build 386 + +package disk + +const ( + MntWait = 1 + MfsNameLen = 15 /* length of fs type name, not inc. nul */ + MNameLen = 90 /* length of buffer for returned name */ + + MFSTYPENAMELEN = 16 /* length of fs type name including null */ + MAXPATHLEN = 1024 + MNAMELEN = MAXPATHLEN + + SYS_GETFSSTAT64 = 347 +) + +type Fsid struct{ val [2]int32 } /* file system id type */ +type uid_t int32 + +// sys/mount.h +const ( + MntReadOnly = 0x00000001 /* read only filesystem */ + MntSynchronous = 0x00000002 /* filesystem written synchronously */ + MntNoExec = 0x00000004 /* can't exec from filesystem */ + MntNoSuid = 0x00000008 /* don't honor setuid bits on fs */ + MntUnion = 0x00000020 /* union with underlying filesystem */ + MntAsync = 0x00000040 /* filesystem written asynchronously */ + MntSuidDir = 0x00100000 /* special handling of SUID on dirs */ + MntSoftDep = 0x00200000 /* soft updates being done */ + MntNoSymFollow = 0x00400000 /* do not follow symlinks */ + MntGEOMJournal = 0x02000000 /* GEOM journal support enabled */ + MntMultilabel = 0x04000000 /* MAC support for individual objects */ + MntACLs = 0x08000000 /* ACL support enabled */ + MntNoATime = 0x10000000 /* disable update of file access time */ + MntClusterRead = 0x40000000 /* disable cluster read */ + MntClusterWrite = 0x80000000 /* disable cluster write */ + MntNFS4ACLs = 0x00000010 +) + +// https://github.com/golang/go/blob/master/src/syscall/ztypes_darwin_386.go#L82 +type Statfs struct { + Bsize uint32 + Iosize int32 + Blocks uint64 + Bfree uint64 + Bavail uint64 + Files uint64 + Ffree uint64 + Fsid Fsid + Owner uint32 + Type uint32 + Flags uint32 + Fssubtype uint32 + Fstypename [16]int8 + Mntonname [1024]int8 + Mntfromname [1024]int8 + Reserved [8]uint32 +} diff --git a/vendor/github.com/shirou/gopsutil/disk/disk_darwin_amd64.go b/vendor/github.com/shirou/gopsutil/disk/disk_darwin_amd64.go index f58e2131274..ec40a758a77 100644 --- a/vendor/github.com/shirou/gopsutil/disk/disk_darwin_amd64.go +++ b/vendor/github.com/shirou/gopsutil/disk/disk_darwin_amd64.go @@ -38,7 +38,7 @@ const ( MntNFS4ACLs = 0x00000010 ) -type Statfs_t struct { +type Statfs struct { Bsize uint32 Iosize int32 Blocks uint64 diff --git a/vendor/github.com/shirou/gopsutil/disk/disk_darwin_arm64.go b/vendor/github.com/shirou/gopsutil/disk/disk_darwin_arm64.go index 52bcf4c8a9b..0e3f6700a6d 100644 --- a/vendor/github.com/shirou/gopsutil/disk/disk_darwin_arm64.go +++ b/vendor/github.com/shirou/gopsutil/disk/disk_darwin_arm64.go @@ -38,7 +38,7 @@ const ( MntNFS4ACLs = 0x00000010 ) -type Statfs_t struct { +type Statfs struct { Bsize uint32 Iosize int32 Blocks uint64 diff --git a/vendor/github.com/shirou/gopsutil/disk/disk_freebsd.go b/vendor/github.com/shirou/gopsutil/disk/disk_freebsd.go index bfb6580c2fe..2e0966a511f 100644 --- a/vendor/github.com/shirou/gopsutil/disk/disk_freebsd.go +++ b/vendor/github.com/shirou/gopsutil/disk/disk_freebsd.go @@ -29,7 +29,9 @@ func PartitionsWithContext(ctx context.Context, all bool) ([]PartitionStat, erro } fs := make([]Statfs, count) - _, err = Getfsstat(fs, MNT_WAIT) + if _, err = Getfsstat(fs, MNT_WAIT); err != nil { + return ret, err + } for _, stat := range fs { opts := "rw" diff --git a/vendor/github.com/shirou/gopsutil/disk/disk_linux.go b/vendor/github.com/shirou/gopsutil/disk/disk_linux.go index f5eb5261bdc..6d0ca9629e3 100644 --- a/vendor/github.com/shirou/gopsutil/disk/disk_linux.go +++ b/vendor/github.com/shirou/gopsutil/disk/disk_linux.go @@ -3,9 +3,11 @@ package disk import ( + "bufio" + "bytes" "context" "fmt" - "os/exec" + "io/ioutil" "path/filepath" "strconv" "strings" @@ -370,6 +372,8 @@ func IOCountersWithContext(ctx context.Context, names ...string) (map[string]IOC d.Name = name d.SerialNumber = GetDiskSerialNumber(name) + d.Label = GetLabel(name) + ret[name] = d } return ret, nil @@ -382,28 +386,55 @@ func GetDiskSerialNumber(name string) string { } func GetDiskSerialNumberWithContext(ctx context.Context, name string) string { - n := fmt.Sprintf("--name=%s", name) - udevadm, err := exec.LookPath("/sbin/udevadm") + var stat unix.Stat_t + err := unix.Stat(name, &stat) if err != nil { return "" } + major := unix.Major(uint64(stat.Rdev)) + minor := unix.Minor(uint64(stat.Rdev)) - out, err := invoke.Command(udevadm, "info", "--query=property", n) + // Try to get the serial from udev data + udevDataPath := fmt.Sprintf("/run/udev/data/b%d:%d", major, minor) + if udevdata, err := ioutil.ReadFile(udevDataPath); err == nil { + scanner := bufio.NewScanner(bytes.NewReader(udevdata)) + for scanner.Scan() { + values := strings.Split(scanner.Text(), "=") + if len(values) == 2 && values[0] == "E:ID_SERIAL" { + return values[1] + } + } + } - // does not return error, just an empty string - if err != nil { + // Try to get the serial from sysfs, look at the disk device (minor 0) directly + // because if it is a partition it is not going to contain any device information + devicePath := fmt.Sprintf("/sys/dev/block/%d:0/device", major) + model, _ := ioutil.ReadFile(filepath.Join(devicePath, "model")) + serial, _ := ioutil.ReadFile(filepath.Join(devicePath, "serial")) + if len(model) > 0 && len(serial) > 0 { + return fmt.Sprintf("%s_%s", string(model), string(serial)) + } + return "" +} + +// GetLabel returns label of given device or empty string on error. +// Name of device is expected, eg. /dev/sda +// Supports label based on devicemapper name +// See https://www.kernel.org/doc/Documentation/ABI/testing/sysfs-block-dm +func GetLabel(name string) string { + // Try label based on devicemapper name + dmname_filename := common.HostSys(fmt.Sprintf("block/%s/dm/name", name)) + + if !common.PathExists(dmname_filename) { return "" } - lines := strings.Split(string(out), "\n") - for _, line := range lines { - values := strings.Split(line, "=") - if len(values) < 2 || values[0] != "ID_SERIAL" { - // only get ID_SERIAL, not ID_SERIAL_SHORT - continue - } - return values[1] + + dmname, err := ioutil.ReadFile(dmname_filename) + if err != nil { + return "" + } else { + return string(dmname) } - return "" } func getFsType(stat unix.Statfs_t) string { diff --git a/vendor/github.com/shirou/gopsutil/disk/disk_openbsd.go b/vendor/github.com/shirou/gopsutil/disk/disk_openbsd.go index 0ac752a5ab8..6fdf38632ed 100644 --- a/vendor/github.com/shirou/gopsutil/disk/disk_openbsd.go +++ b/vendor/github.com/shirou/gopsutil/disk/disk_openbsd.go @@ -27,7 +27,9 @@ func PartitionsWithContext(ctx context.Context, all bool) ([]PartitionStat, erro } fs := make([]Statfs, count) - _, err = Getfsstat(fs, MNT_WAIT) + if _, err = Getfsstat(fs, MNT_WAIT); err != nil { + return ret, err + } for _, stat := range fs { opts := "rw" diff --git a/vendor/github.com/shirou/gopsutil/disk/disk_windows.go b/vendor/github.com/shirou/gopsutil/disk/disk_windows.go index 7389b5a7c51..326bc1f4243 100644 --- a/vendor/github.com/shirou/gopsutil/disk/disk_windows.go +++ b/vendor/github.com/shirou/gopsutil/disk/disk_windows.go @@ -144,8 +144,6 @@ func IOCountersWithContext(ctx context.Context, names ...string) (map[string]IOC ret := make(map[string]IOCountersStat, 0) var dst []Win32_PerfFormattedData - ctx, cancel := context.WithTimeout(context.Background(), common.Timeout) - defer cancel() err := common.WMIQueryWithContext(ctx, "SELECT * FROM Win32_PerfFormattedData_PerfDisk_LogicalDisk", &dst) if err != nil { return ret, err diff --git a/vendor/github.com/shirou/gopsutil/internal/common/common.go b/vendor/github.com/shirou/gopsutil/internal/common/common.go index fcee6be85a6..f9373ee8945 100644 --- a/vendor/github.com/shirou/gopsutil/internal/common/common.go +++ b/vendor/github.com/shirou/gopsutil/internal/common/common.go @@ -32,15 +32,19 @@ var ( type Invoker interface { Command(string, ...string) ([]byte, error) + CommandWithContext(context.Context, string, ...string) ([]byte, error) } type Invoke struct{} func (i Invoke) Command(name string, arg ...string) ([]byte, error) { - ctxt, cancel := context.WithTimeout(context.Background(), Timeout) + ctx, cancel := context.WithTimeout(context.Background(), Timeout) defer cancel() + return i.CommandWithContext(ctx, name, arg...) +} - cmd := exec.CommandContext(ctxt, name, arg...) +func (i Invoke) CommandWithContext(ctx context.Context, name string, arg ...string) ([]byte, error) { + cmd := exec.CommandContext(ctx, name, arg...) var buf bytes.Buffer cmd.Stdout = &buf @@ -84,6 +88,10 @@ func (i FakeInvoke) Command(name string, arg ...string) ([]byte, error) { return []byte{}, fmt.Errorf("could not find testdata: %s", fpath) } +func (i FakeInvoke) CommandWithContext(ctx context.Context, name string, arg ...string) ([]byte, error) { + return i.Command(name, arg...) +} + var ErrNotImplementedError = errors.New("not implemented yet") // ReadLines reads contents from a file and splits them by new lines. diff --git a/vendor/github.com/shirou/gopsutil/internal/common/common_darwin.go b/vendor/github.com/shirou/gopsutil/internal/common/common_darwin.go index 2b6d4c149d0..3e85cc06b8a 100644 --- a/vendor/github.com/shirou/gopsutil/internal/common/common_darwin.go +++ b/vendor/github.com/shirou/gopsutil/internal/common/common_darwin.go @@ -3,6 +3,7 @@ package common import ( + "context" "os" "os/exec" "strings" @@ -11,12 +12,12 @@ import ( "golang.org/x/sys/unix" ) -func DoSysctrl(mib string) ([]string, error) { +func DoSysctrlWithContext(ctx context.Context, mib string) ([]string, error) { sysctl, err := exec.LookPath("/usr/sbin/sysctl") if err != nil { return []string{}, err } - cmd := exec.Command(sysctl, "-n", mib) + cmd := exec.CommandContext(ctx, sysctl, "-n", mib) cmd.Env = getSysctrlEnv(os.Environ()) out, err := cmd.Output() if err != nil { diff --git a/vendor/github.com/shirou/gopsutil/internal/common/common_unix.go b/vendor/github.com/shirou/gopsutil/internal/common/common_unix.go index cc934dd6e92..750a5926d07 100644 --- a/vendor/github.com/shirou/gopsutil/internal/common/common_unix.go +++ b/vendor/github.com/shirou/gopsutil/internal/common/common_unix.go @@ -3,12 +3,13 @@ package common import ( + "context" "os/exec" "strconv" "strings" ) -func CallLsof(invoke Invoker, pid int32, args ...string) ([]string, error) { +func CallLsofWithContext(ctx context.Context, invoke Invoker, pid int32, args ...string) ([]string, error) { var cmd []string if pid == 0 { // will get from all processes. cmd = []string{"-a", "-n", "-P"} @@ -20,7 +21,7 @@ func CallLsof(invoke Invoker, pid int32, args ...string) ([]string, error) { if err != nil { return []string{}, err } - out, err := invoke.Command(lsof, cmd...) + out, err := invoke.CommandWithContext(ctx, lsof, cmd...) if err != nil { // if no pid found, lsof returnes code 1. if err.Error() == "exit status 1" && len(out) == 0 { @@ -39,14 +40,14 @@ func CallLsof(invoke Invoker, pid int32, args ...string) ([]string, error) { return ret, nil } -func CallPgrep(invoke Invoker, pid int32) ([]int32, error) { +func CallPgrepWithContext(ctx context.Context, invoke Invoker, pid int32) ([]int32, error) { var cmd []string cmd = []string{"-P", strconv.Itoa(int(pid))} pgrep, err := exec.LookPath("pgrep") if err != nil { return []int32{}, err } - out, err := invoke.Command(pgrep, cmd...) + out, err := invoke.CommandWithContext(ctx, pgrep, cmd...) if err != nil { return []int32{}, err } diff --git a/vendor/github.com/shirou/gopsutil/internal/common/common_windows.go b/vendor/github.com/shirou/gopsutil/internal/common/common_windows.go index 1dffe615856..b02c5cf2436 100644 --- a/vendor/github.com/shirou/gopsutil/internal/common/common_windows.go +++ b/vendor/github.com/shirou/gopsutil/internal/common/common_windows.go @@ -115,6 +115,12 @@ func CreateCounter(query windows.Handle, pname, cname string) (*CounterInfo, err // WMIQueryWithContext - wraps wmi.Query with a timed-out context to avoid hanging func WMIQueryWithContext(ctx context.Context, query string, dst interface{}, connectServerArgs ...interface{}) error { + if _, ok := ctx.Deadline(); !ok { + ctxTimeout, cancel := context.WithTimeout(ctx, Timeout) + defer cancel() + ctx = ctxTimeout + } + errChan := make(chan error, 1) go func() { errChan <- wmi.Query(query, dst, connectServerArgs...) diff --git a/vendor/github.com/shirou/gopsutil/net/net.go b/vendor/github.com/shirou/gopsutil/net/net.go index 428e68e1eb3..c31f512429d 100644 --- a/vendor/github.com/shirou/gopsutil/net/net.go +++ b/vendor/github.com/shirou/gopsutil/net/net.go @@ -12,11 +12,7 @@ import ( "github.com/shirou/gopsutil/internal/common" ) -var invoke common.Invoker - -func init() { - invoke = common.Invoke{} -} +var invoke common.Invoker = common.Invoke{} type IOCountersStat struct { Name string `json:"name"` // interface name diff --git a/vendor/github.com/shirou/gopsutil/net/net_darwin.go b/vendor/github.com/shirou/gopsutil/net/net_darwin.go index 2afb0f0898a..0d89280f98f 100644 --- a/vendor/github.com/shirou/gopsutil/net/net_darwin.go +++ b/vendor/github.com/shirou/gopsutil/net/net_darwin.go @@ -180,7 +180,7 @@ func IOCountersWithContext(ctx context.Context, pernic bool) ([]IOCountersStat, } // try to get all interface metrics, and hope there won't be any truncated - out, err := invoke.Command(netstat, "-ibdnW") + out, err := invoke.CommandWithContext(ctx, netstat, "-ibdnW") if err != nil { return nil, err } @@ -208,7 +208,7 @@ func IOCountersWithContext(ctx context.Context, pernic bool) ([]IOCountersStat, if err != nil { return nil, err } - if out, err = invoke.Command(ifconfig, "-l"); err != nil { + if out, err = invoke.CommandWithContext(ctx, ifconfig, "-l"); err != nil { return nil, err } interfaceNames := strings.Fields(strings.TrimRight(string(out), endOfLine)) @@ -227,7 +227,7 @@ func IOCountersWithContext(ctx context.Context, pernic bool) ([]IOCountersStat, } if truncated { // run netstat with -I$ifacename - if out, err = invoke.Command(netstat, "-ibdnWI"+interfaceName); err != nil { + if out, err = invoke.CommandWithContext(ctx, netstat, "-ibdnWI"+interfaceName); err != nil { return nil, err } parsedIfaces, err := parseNetstatOutput(string(out)) diff --git a/vendor/github.com/shirou/gopsutil/net/net_freebsd.go b/vendor/github.com/shirou/gopsutil/net/net_freebsd.go index 9daed8d71f3..ce0241576fe 100644 --- a/vendor/github.com/shirou/gopsutil/net/net_freebsd.go +++ b/vendor/github.com/shirou/gopsutil/net/net_freebsd.go @@ -21,7 +21,7 @@ func IOCountersWithContext(ctx context.Context, pernic bool) ([]IOCountersStat, if err != nil { return nil, err } - out, err := invoke.Command(netstat, "-ibdnW") + out, err := invoke.CommandWithContext(ctx, netstat, "-ibdnW") if err != nil { return nil, err } diff --git a/vendor/github.com/shirou/gopsutil/net/net_openbsd.go b/vendor/github.com/shirou/gopsutil/net/net_openbsd.go index 4b194eb6e32..3e74e8f3add 100644 --- a/vendor/github.com/shirou/gopsutil/net/net_openbsd.go +++ b/vendor/github.com/shirou/gopsutil/net/net_openbsd.go @@ -106,11 +106,11 @@ func IOCountersWithContext(ctx context.Context, pernic bool) ([]IOCountersStat, if err != nil { return nil, err } - out, err := invoke.Command(netstat, "-inb") + out, err := invoke.CommandWithContext(ctx, netstat, "-inb") if err != nil { return nil, err } - out2, err := invoke.Command(netstat, "-ind") + out2, err := invoke.CommandWithContext(ctx, netstat, "-ind") if err != nil { return nil, err } @@ -290,7 +290,7 @@ func ConnectionsWithContext(ctx context.Context, kind string) ([]ConnectionStat, if err != nil { return nil, err } - out, err := invoke.Command(netstat, args...) + out, err := invoke.CommandWithContext(ctx, netstat, args...) if err != nil { return nil, err diff --git a/vendor/github.com/shirou/gopsutil/net/net_unix.go b/vendor/github.com/shirou/gopsutil/net/net_unix.go index 5ceb9cc5425..e3ff262e2cf 100644 --- a/vendor/github.com/shirou/gopsutil/net/net_unix.go +++ b/vendor/github.com/shirou/gopsutil/net/net_unix.go @@ -66,7 +66,7 @@ func ConnectionsPidWithContext(ctx context.Context, kind string, pid int32) ([]C return ret, common.ErrNotImplementedError } - r, err := common.CallLsof(invoke, pid, args...) + r, err := common.CallLsofWithContext(ctx, invoke, pid, args...) if err != nil { return nil, err } diff --git a/vendor/vendor.json b/vendor/vendor.json index 7a07365d129..f55287a7e0a 100644 --- a/vendor/vendor.json +++ b/vendor/vendor.json @@ -521,7 +521,7 @@ }, { "path": "github.com/elastic/go-structform/internal/visitors", - "revision": "", + "revision": "v0.0.4", "version": "v0.0.4", "versionExact": "v0.0.4" }, @@ -1310,28 +1310,36 @@ "revisionTime": "2017-03-21T23:07:31Z" }, { - "checksumSHA1": "lZRqG0Rl5w+mkaTUOuEjcKvNU6c=", + "checksumSHA1": "wZ7Q/3JyIlVKeYVqRUGh1zuLa9E=", + "path": "github.com/shirou/gopsutil", + "revision": "4a180b209f5f494e5923cfce81ea30ba23915877", + "revisionTime": "2018-06-25T08:11:43Z", + "version": "v2.18.06", + "versionExact": "v2.18.06" + }, + { + "checksumSHA1": "RPCF/ke7rAfTtFnU1M3jCZIKsj0=", "path": "github.com/shirou/gopsutil/disk", - "revision": "c432be29ccce470088d07eea25b3ea7e68a8afbb", - "revisionTime": "2018-01-30T01:13:38Z", - "version": "v2.18.01", - "versionExact": "v2.18.01" + "revision": "4a180b209f5f494e5923cfce81ea30ba23915877", + "revisionTime": "2018-06-25T08:11:43Z", + "version": "v2.18.06", + "versionExact": "v2.18.06" }, { - "checksumSHA1": "jWpwWWcywJPNhKTYxi4RXds+amQ=", + "checksumSHA1": "ElneFnzdyg/mWfMFukLUHdy9DHY=", "path": "github.com/shirou/gopsutil/internal/common", - "revision": "c432be29ccce470088d07eea25b3ea7e68a8afbb", - "revisionTime": "2018-01-30T01:13:38Z", - "version": "v2.18.01", - "versionExact": "v2.18.01" + "revision": "4a180b209f5f494e5923cfce81ea30ba23915877", + "revisionTime": "2018-06-25T08:11:43Z", + "version": "v2.18.06", + "versionExact": "v2.18.06" }, { - "checksumSHA1": "Z7FjZvR5J5xh6Ne572gD7tRUsc8=", + "checksumSHA1": "cqp+0Xxb51xFf3ekjlaS/EpipZU=", "path": "github.com/shirou/gopsutil/net", - "revision": "c432be29ccce470088d07eea25b3ea7e68a8afbb", - "revisionTime": "2018-01-30T01:13:38Z", - "version": "v2.18.01", - "versionExact": "v2.18.01" + "revision": "4a180b209f5f494e5923cfce81ea30ba23915877", + "revisionTime": "2018-06-25T08:11:43Z", + "version": "v2.18.06", + "versionExact": "v2.18.06" }, { "checksumSHA1": "e7mAb9jMke2ASQGZepFgOmfBFzM=",