Update procfs vendor (#1248)

Signed-off-by: Mark Knapp <mknapp@hudson-trading.com>
This commit is contained in:
mknapphrt 2019-02-04 10:54:41 -05:00 committed by Ben Kochie
commit 7fbdd0ae93
26 changed files with 2200 additions and 156 deletions

View file

@ -57,3 +57,17 @@ func ReadUintFromFile(path string) (uint64, error) {
}
return strconv.ParseUint(strings.TrimSpace(string(data)), 10, 64)
}
// ParseBool parses a string into a boolean pointer.
func ParseBool(b string) *bool {
var truth bool
switch b {
case "enabled":
truth = true
case "disabled":
truth = false
default:
return nil
}
return &truth
}