You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The call to bytes.TrimRightFunc(src[0:i], trimFunc) in parser.go's extractVarValue removes a single escaped quote off the right side of the var value (if such a quote exists and it is the same as the quotes used to enclose the value). Is this intended behavior or a bug?
package main
import (
"fmt"
"github.com/joho/godotenv"
)
func main() {
m := map[string]string{"foo": `""`}
// Shows up in .env as foo="\"\""
godotenv.Write(m, ".env")
env, _ := godotenv.Read(".env")
// Expecting ""
// Instead prints "\
// This is because the escaping \ remains after the quote's removed
fmt.Println(env["foo"])
}
The text was updated successfully, but these errors were encountered:
The call to
bytes.TrimRightFunc(src[0:i], trimFunc)
in parser.go'sextractVarValue
removes a single escaped quote off the right side of the var value (if such a quote exists and it is the same as the quotes used to enclose the value). Is this intended behavior or a bug?The text was updated successfully, but these errors were encountered: