envsubst -no-unset blows up on ${FOO:=}
- Langage dominant
- Go
- Étoiles
- 907
- Forks
- 96
- Métriques de merge des PR
- Aucune PR mergée en 30 j
Description
It seems that an empty default value is treated as if a default value has not been provided.
Expected:
```console
~ $ go install github.com/a8m/envsubst/cmd/envsubst@v1.4.2
~ $ go/bin/envsubst -no-unset <<< 'value: ${FOO:=}'
value:
~ $ echo $?
0
~ $
```
Got:
```console
~ $ go install github.com/a8m/envsubst/cmd/envsubst@v1.4.2
~ $ go/bin/envsubst -no-unset <<< 'value: ${FOO:=}'
variable ${FOO} not set
~ $ echo $?
1
~ $
```
Guide de contribution
Aucun guide de contribution indexé pour ce dépôt
Piste de recherche
Look at the parsing logic for variable substitution in the source code, likely in a file like parse.go or subst.go. The bug is that ${FOO:=} with an empty default is incorrectly flagged as unset when -no-unset is used. Run the existing tests to see how defaults are handled, then add a test case for this scenario and fix the parsing to treat empty defaults as valid.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Évaluation
- Stack technique
- go, shell
- Domaine
- cli, tooling
- Type d'issue
- Bug
- Difficulté
- 2/5
- Temps estimé
- 1-3 heures
- Activité
- À l'abandon
- Clarté
- Clairement spécifiée
- Accessibilité débutants
- 65/100