MCPcopy Create free account
hub / github.com/1Panel-dev/1Panel / GetEnvValueByKey

Function GetEnvValueByKey

agent/utils/env/env.go:98–108  ·  view source on GitHub ↗
(envPath, key string)

Source from the content-addressed store, hash-verified

96}
97
98func GetEnvValueByKey(envPath, key string) (string, error) {
99 envMap, err := godotenv.Read(envPath)
100 if err != nil {
101 return "", err
102 }
103 value, ok := envMap[key]
104 if !ok {
105 return "", fmt.Errorf("key %s not found in %s", key, envPath)
106 }
107 return value, nil
108}
109
110func isStartWithZero(value string) bool {
111 if strings.HasPrefix(value, "0") && len(value) > 1 {

Callers

nothing calls this directly

Calls 1

ReadMethod · 0.45

Tested by

no test coverage detected