(k, v string)
| 86 | } |
| 87 | |
| 88 | func formatEnvLine(k, v string) string { |
| 89 | if d, err := strconv.Atoi(v); err == nil && !isStartWithZero(v) { |
| 90 | return fmt.Sprintf(`%s=%d`, k, d) |
| 91 | } else if shouldUseSingleQuotes(v) { |
| 92 | return fmt.Sprintf(`%s='%s'`, k, v) |
| 93 | } else { |
| 94 | return fmt.Sprintf(`%s="%s"`, k, escapeDoubleQuotedEnvValue(v)) |
| 95 | } |
| 96 | } |
| 97 | |
| 98 | func GetEnvValueByKey(envPath, key string) (string, error) { |
| 99 | envMap, err := godotenv.Read(envPath) |
no test coverage detected