summaryrefslogtreecommitdiff
path: root/pkg/env/env_unix.go
blob: 16061a7003bd2b276bba9d0aeac937c85590f2e3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
// +build !windows

package env

// ParseSlice parses the specified slice and transforms it into an environment
// map.
func ParseSlice(s []string) (map[string]string, error) {
	env := make(map[string]string, len(s))
	for _, e := range s {
		if err := parseEnv(env, e); err != nil {
			return nil, err
		}
	}
	return env, nil
}