a8m / envsubst

Environment variables substitution for Go
MIT License
747 stars 83 forks source link

envsubst -no-unset blows up on ${FOO:=} #61

Open filip-zyzniewski opened 4 months ago

filip-zyzniewski commented 4 months ago

It seems that an empty default value is treated as if a default value has not been provided.

Expected:

~ $ go install github.com/a8m/envsubst/cmd/envsubst@v1.4.2
~ $ go/bin/envsubst -no-unset <<< 'value: ${FOO:=}'
value: 
~ $ echo $?
0
~ $ 

Got:

~ $ go install github.com/a8m/envsubst/cmd/envsubst@v1.4.2
~ $ go/bin/envsubst -no-unset <<< 'value: ${FOO:=}' 
variable ${FOO} not set

~ $ echo $?
1
~ $