joho / godotenv

A Go port of Ruby's dotenv library (Loads environment variables from .env files)
http://godoc.org/github.com/joho/godotenv
MIT License
8.5k stars 406 forks source link

Inconsistency with ruby dotenv: handling of alphabetical $ variables #155

Open hpello opened 3 years ago

hpello commented 3 years ago

What do you want to report?

Inconsistency with ruby dotenv

What version?

What do you observe?

When the x variable is not defined, Numeric $x fields disappear, but alphabetical $x fields remain. In the case of $x, only the is swallowed. => It is not the same result with godotenv than with ruby's dotenv

What env file do you use?

What do you observe?

# result of: godotenv env | grep VARIABLE
VARIABLE_0=$ax
VARIABLE_1=$ax
VARIABLE_2=$a$0$12$_x
VARIABLE_3=$ax

What is the expected result?

With ruby's dotenv:

# result of: dotenv env | grep VARIABLE
VARIABLE_0=
VARIABLE_1=
VARIABLE_2=$a$0$12$_x
VARIABLE_3=