Documentation ¶
Index ¶
- func ConvertKVStringsToMap(values []string) map[string]string
- func DedupeStrSlice(in []string) []string
- func InStringSlice(ss []string, str string) bool
- func ParseBoolOrAuto(s string) (*bool, error)
- func ParseCSVMap(s string) (map[string]string, error)
- func ReverseStrSlice(in []string) []string
- func SliceToSet(in []string) map[string]bool
- func TrimStrSliceRight(base, extra []string) []string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ConvertKVStringsToMap ¶
ConvertKVStringsToMap is from https://github.com/moby/moby/blob/v20.10.0-rc2/runconfig/opts/parse.go
ConvertKVStringsToMap converts ["key=value"] to {"key":"value"}
func DedupeStrSlice ¶
func InStringSlice ¶
InStringSlice checks whether a string is inside a string slice. Comparison is case insensitive.
func ParseBoolOrAuto ¶ added in v0.13.0
ParseBoolOrAuto returns (nil, nil) if s is "auto" https://github.com/moby/buildkit/blob/v0.9.1/cmd/buildkitd/config.go#L35-L42
func ParseCSVMap ¶ added in v0.7.3
ParseCSVMap parses a string like "foo=x,bar=y" into a map
func ReverseStrSlice ¶ added in v0.13.0
func SliceToSet ¶ added in v1.5.0
SliceToSet converts a slice of strings into a set. In Go, a set is often represented as a map with keys as the set elements and values as boolean. This function iterates over the slice, adding each string as a key in the map. The corresponding map value is set to true, serving as a placeholder. The resulting map can be used to quickly check the presence of an element in the set.
func TrimStrSliceRight ¶ added in v0.8.0
Types ¶
This section is empty.