[host][linux] Properly handle double quotes in /etc/os-release in PlatformInformation

pull/698/head
Lomanic 6 years ago
parent a0019d431c
commit 3af6e1ffe7

@ -247,9 +247,9 @@ func getOSRelease() (platform string, version string, err error) {
} }
switch field[0] { switch field[0] {
case "ID": // use ID for lowercase case "ID": // use ID for lowercase
platform = field[1] platform = strings.Trim(field[1], `"`)
case "VERSION": case "VERSION":
version = field[1] version = strings.Trim(field[1], `"`)
} }
} }
return platform, version, nil return platform, version, nil

Loading…
Cancel
Save