joho/godotenv — pull request #4 by Bochenski (2014-06-25 15:26:52+00:00)
Title: Possible issue with Windows line endings?

I've hit an issue on windows, that I think is to do with how godotenv handles line endings.

Given you have a text file at c:\test.txt with a few lines in it and the following go program:

````
package main

import (
"bufio"
"github.com/joho/godotenv"
"log"
"os"
)

func main() {
err := godotenv.Load()
if err != nil {
log.Fatalf("Error loading .env file %s\n", err.Error())
}

path := os.Getenv("A_PATH")

log.Printf("path: %v", path)

file, err := os.Open(path)
if err != nil {
log.Fatalf("error opening file: %s", err.Error())
}

defer file.Close()

scanner := bufio.NewScanner(file)

for scanner.Scan() {
log.Println(scanner.Text())
}

log.Println("Everything ok")
}
````

If the .env file (located in the same folder as the application) contains
````
A_PATH=C:\\test.txt
````

then runs correctly, and the contents of c:\test.txt are printed to the console.

if however you have multiple lines in the .env file; for instance
````
A_PATH=C:\\test.txt
SOMETHING_ELSE=anothervar
````

Then on running the program it errors, outputting

````
: the filename, directory name, or volume label syntax is incorrect.
````

I'm just narrowing down the problem - I suspect it may be to do with windows line returns.

If I can fix it would you be willing to accept a Pull request?