Files
podman/vendor/github.com/openshift/imagebuilder/internal/env.go
renovate[bot] 215af114ab Update module github.com/openshift/imagebuilder to v1.2.15
Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-08-22 15:57:06 +00:00

24 lines
433 B
Go

package internal
import "strings"
type EnvironmentSlice []string
func (e EnvironmentSlice) Keys() []string {
keys := make([]string, 0, len(e))
for _, kv := range e {
k, _, _ := strings.Cut(kv, "=")
keys = append(keys, k)
}
return keys
}
func (e EnvironmentSlice) Get(key string) (string, bool) {
for _, kv := range e {
if k, v, ok := strings.Cut(kv, "="); ok && k == key {
return v, true
}
}
return "", false
}