mirror of
https://github.com/opencloud-eu/opencloud.git
synced 2026-01-22 04:50:43 -05:00
Bumps [github.com/gookit/config/v2](https://github.com/gookit/config) from 2.2.6 to 2.2.7. - [Release notes](https://github.com/gookit/config/releases) - [Commits](https://github.com/gookit/config/compare/v2.2.6...v2.2.7) --- updated-dependencies: - dependency-name: github.com/gookit/config/v2 dependency-version: 2.2.7 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com>
23 lines
418 B
Go
23 lines
418 B
Go
package comfunc
|
|
|
|
import (
|
|
"os"
|
|
"strings"
|
|
)
|
|
|
|
// Environ like os.Environ, but will returns key-value map[string]string data.
|
|
func Environ() map[string]string {
|
|
envList := os.Environ()
|
|
envMap := make(map[string]string, len(envList))
|
|
|
|
for _, str := range envList {
|
|
nodes := strings.SplitN(str, "=", 2)
|
|
if len(nodes) < 2 {
|
|
envMap[nodes[0]] = ""
|
|
} else {
|
|
envMap[nodes[0]] = nodes[1]
|
|
}
|
|
}
|
|
return envMap
|
|
}
|