buildkit/cmd/buildkitd/util.go

16 lines
266 B
Go

package main
import (
"strconv"
"strings"
)
// parseBoolOrAuto returns (nil, nil) if s is "auto"
func parseBoolOrAuto(s string) (*bool, error) {
if s == "" || strings.ToLower(s) == "auto" {
return nil, nil
}
b, err := strconv.ParseBool(s)
return &b, err
}