From 98e2598e61031526f62e9ea696348651056e9da9 Mon Sep 17 00:00:00 2001 From: John Barton Date: Sun, 5 Feb 2023 22:05:56 +1100 Subject: [PATCH] Bring back FOO.BAR names --- godotenv_test.go | 2 -- parser.go | 4 ++-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/godotenv_test.go b/godotenv_test.go index 8520a24..edb5781 100644 --- a/godotenv_test.go +++ b/godotenv_test.go @@ -400,8 +400,6 @@ func TestParsing(t *testing.T) { parseAndCompare(t, `FOO="bar\\r\ b\az"`, "FOO", "bar\\r baz") parseAndCompare(t, `="value"`, "", "value") - parseAndCompare(t, `KEY="`, "KEY", "\"") - parseAndCompare(t, `KEY="value`, "KEY", "\"value") // unquoted whitespace around keys should be ignored parseAndCompare(t, " KEY =value", "KEY", "value") diff --git a/parser.go b/parser.go index f2cbddf..203f976 100644 --- a/parser.go +++ b/parser.go @@ -101,8 +101,8 @@ loop: break loop case '_': default: - // variable name should match [A-Za-z0-9_] - if unicode.IsLetter(rchar) || unicode.IsNumber(rchar) { + // variable name should match [A-Za-z0-9_.] + if unicode.IsLetter(rchar) || unicode.IsNumber(rchar) || rchar == '.' { continue }