We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 4321598 commit b311b26Copy full SHA for b311b26
godotenv.go
@@ -14,10 +14,10 @@
14
package godotenv
15
16
import (
17
+ "bytes"
18
"errors"
19
"fmt"
20
"io"
- "io/ioutil"
21
"os"
22
"os/exec"
23
"regexp"
@@ -30,12 +30,13 @@ const doubleQuoteSpecialChars = "\\\n\r\"!$`"
30
31
// Parse reads an env file from io.Reader, returning a map of keys and values.
32
func Parse(r io.Reader) (map[string]string, error) {
33
- data, err := ioutil.ReadAll(r)
+ var buf bytes.Buffer
34
+ _, err := io.Copy(&buf, r)
35
if err != nil {
36
return nil, err
37
}
38
- return UnmarshalBytes(data)
39
+ return UnmarshalBytes(buf.Bytes())
40
41
42
// Load will read your env file(s) and load them into ENV for this process.
0 commit comments