#EnvFile: better dotenv compatibility, mo...
1 messages · Page 1 of 1 (latest)
Quick questions (design decisions).
How compliant do you want to be with the shell expansion / .env ?
What do you expect for these edge cases ?
{
name: "expand empty var is allowed",
environ: []string{
"EMPTY=",
"X=$EMPTY",
},
want: map[string]string{
"EMPTY": "",
"X": "",
},
},
{
name: "unquoted trailing comment",
environ: []string{
"FOO=bar # trailing",
},
want: map[string]string{
"FOO": "bar",
},
},
{
name: "hash inside value is literal when no ws",
environ: []string{
"FOO=bar#baz",
},
want: map[string]string{
"FOO": "bar#baz",
},
},
{
name: "export prefix",
environ: []string{
"export FOO=bar",
},
want: map[string]string{
"FOO": "bar",
},
},
{
name: "spaces around equals",
environ: []string{
"FOO = bar",
},
want: map[string]string{
"FOO": "bar",
},
},
{
name: "quoted then comment",
environ: []string{`FOO="a b" # keep only a b`},
want: map[string]string{
"FOO": "a b",
},
},
Are these test cases that you are adding, or they're already in there?
I've been testing a few things (locally), some are here to understand how opinionated your implementation is, thus my question