forked from coop-cloud-mirrors/godotenv
Fix up bad merge
This commit is contained in:
parent
c723940cb5
commit
08d75deb23
10
godotenv.go
10
godotenv.go
@ -108,7 +108,15 @@ func Read(filenames ...string) (envMap map[string]string, err error) {
|
|||||||
|
|
||||||
// Unmarshal reads an env file from a string, returning a map of keys and values.
|
// Unmarshal reads an env file from a string, returning a map of keys and values.
|
||||||
func Unmarshal(str string) (envMap map[string]string, err error) {
|
func Unmarshal(str string) (envMap map[string]string, err error) {
|
||||||
return Parse(strings.NewReader(str))
|
return UnmarshalBytes([]byte(str))
|
||||||
|
}
|
||||||
|
|
||||||
|
// UnmarshalBytes parses env file from byte slice of chars, returning a map of keys and values.
|
||||||
|
func UnmarshalBytes(src []byte) (map[string]string, error) {
|
||||||
|
out := make(map[string]string)
|
||||||
|
err := parseBytes(src, out)
|
||||||
|
|
||||||
|
return out, err
|
||||||
}
|
}
|
||||||
|
|
||||||
// Exec loads env vars from the specified filenames (empty map falls back to default)
|
// Exec loads env vars from the specified filenames (empty map falls back to default)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user