blob: e6c19ee81feb2126f3ab12fd159e05437ec5990b [file] [log] [blame]
package graphdriver
import (
"fmt"
"strings"
)
// ParseStorageOptKeyValue parses and validates the specified string as a key/value
// pair (key=value).
func ParseStorageOptKeyValue(opt string) (key string, value string, err error) {
k, v, ok := strings.Cut(opt, "=")
if !ok {
return "", "", fmt.Errorf("unable to parse storage-opt key/value: %s", opt)
}
return strings.TrimSpace(k), strings.TrimSpace(v), nil
}