forked from coop-cloud-mirrors/godotenv
Propagate errors encountered when reading file
This commit is contained in:
@ -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)
|
||||
|
Reference in New Issue
Block a user