Ignoring leading whitespace

Signed-off-by: Dave Henderson <dhenderson@gmail.com>
This commit is contained in:
Dave Henderson
2019-02-03 22:39:38 -05:00
parent 69ed1d913a
commit 79711eebaf
2 changed files with 12 additions and 3 deletions

View File

@ -256,7 +256,7 @@ func parseLine(line string, envMap map[string]string) (key string, value string,
if strings.HasPrefix(key, "export") {
key = strings.TrimPrefix(key, "export")
}
key = strings.Trim(key, " ")
key = strings.TrimSpace(key)
// Parse the value
value = parseValue(splitString[1], envMap)
@ -327,7 +327,7 @@ func expandVariables(v string, m map[string]string) string {
}
func isIgnoredLine(line string) bool {
trimmedLine := strings.Trim(line, " \n\t")
trimmedLine := strings.TrimSpace(line)
return len(trimmedLine) == 0 || strings.HasPrefix(trimmedLine, "#")
}