Propagate errors encountered when reading file

This commit is contained in:
Martin Milata
2016-12-12 14:41:36 +01:00
parent 4ed13390c0
commit 0ff0c0fc7a
2 changed files with 13 additions and 0 deletions

View File

@ -143,6 +143,10 @@ func readFile(filename string) (envMap map[string]string, err error) {
lines = append(lines, scanner.Text())
}
if err = scanner.Err(); err != nil {
return
}
for _, fullLine := range lines {
if !isIgnoredLine(fullLine) {
key, value, err := parseLine(fullLine)