This commit is contained in:
Caleb Bassi 2018-11-15 10:07:32 -08:00
parent d44be12684
commit 57781676d8

View File

@ -58,9 +58,12 @@ func (self *Disk) update() {
for _, Part := range Partitions { for _, Part := range Partitions {
device := strings.Replace(Part.Device, "/dev/", "", -1) device := strings.Replace(Part.Device, "/dev/", "", -1)
if _, ok := self.Partitions[device]; !ok { if _, ok := self.Partitions[device]; !ok {
// https://github.com/shirou/gopsutil/issues/555
// have to remove artifacts produced by gopsutil when there's a space in the mount path
mountPoint := strings.Replace(Part.Mountpoint, "\\040", " ", -1)
self.Partitions[device] = &Partition{ self.Partitions[device] = &Partition{
Device: device, Device: device,
Mount: Part.Mountpoint, Mount: mountPoint,
} }
} }
} }