From da57f36193af948a134a28af8f1a2f70fcc24d4c Mon Sep 17 00:00:00 2001 From: Timon Ringwald Date: Thu, 4 Aug 2022 17:04:00 +0200 Subject: [PATCH] allow empty lines --- main.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main.go b/main.go index 01e3710..6fe0aa8 100644 --- a/main.go +++ b/main.go @@ -67,7 +67,7 @@ func parseEnvFile(r io.Reader) []string { if len(matches) != 0 { key, value := matches[1], os.ExpandEnv(matches[2]) env = append(env, fmt.Sprintf("%s=%s", key, value)) - } else if !EnvCommentRegex.MatchString(s.Text()) { + } else if s.Text() != "" && !EnvCommentRegex.MatchString(s.Text()) { panic(fmt.Sprintf("invalid env syntax on line %d", l)) } }