mirror of
https://github.com/openfaas/faas.git
synced 2025-06-20 13:06:40 +00:00
Migrate to Go modules
Signed-off-by: Alex Ellis (OpenFaaS Ltd) <alexellis2@gmail.com>
This commit is contained in:
committed by
Alex Ellis
parent
2e2250afe8
commit
7ce266adc0
9
gateway/vendor/github.com/prometheus/procfs/internal/util/parse.go
generated
vendored
9
gateway/vendor/github.com/prometheus/procfs/internal/util/parse.go
generated
vendored
@ -73,6 +73,15 @@ func ReadUintFromFile(path string) (uint64, error) {
|
||||
return strconv.ParseUint(strings.TrimSpace(string(data)), 10, 64)
|
||||
}
|
||||
|
||||
// ReadIntFromFile reads a file and attempts to parse a int64 from it.
|
||||
func ReadIntFromFile(path string) (int64, error) {
|
||||
data, err := ioutil.ReadFile(path)
|
||||
if err != nil {
|
||||
return 0, err
|
||||
}
|
||||
return strconv.ParseInt(strings.TrimSpace(string(data)), 10, 64)
|
||||
}
|
||||
|
||||
// ParseBool parses a string into a boolean pointer.
|
||||
func ParseBool(b string) *bool {
|
||||
var truth bool
|
||||
|
Reference in New Issue
Block a user