From fda98ebc344591c41442ef6a62b7c5e77b2092df Mon Sep 17 00:00:00 2001 From: Remy Mathieu Date: Mon, 17 Dec 2018 10:52:04 +0100 Subject: [PATCH] disk: trim the device mapper name. While reading the value of the file with `ioutil.ReadFile`, the name is suffixed with a `\n` Tested on Ubuntu 18.10 --- disk/disk_linux.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/disk/disk_linux.go b/disk/disk_linux.go index 3d68936..6539250 100644 --- a/disk/disk_linux.go +++ b/disk/disk_linux.go @@ -433,7 +433,7 @@ func GetLabel(name string) string { if err != nil { return "" } else { - return string(dmname) + return strings.TrimSpace(string(dmname)) } }