Can I get the original value if variable empty
Aperta
- Lingua principale
- Go
- Stelle
- 907
- Fork
- 96
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Descrizione
Hi, I need to know if there is a variable in my text that is empty after expanding it. I need those variables not to expand and use the original string.
```golang
os.Setenv("GREETINGS", "hello")
value := "$GREETINGS $NAME"
result, err := envsubst.String(value)
if err != nil {
return "", fmt.Errorf("error expanding environment on '%s': %s", value, err.Error())
}
fmt.Println(result) // The output is: "hello "
```
Is there a way of getting `hello $NAME` as the output?
Guida per i contributori
Nessuna guida per i contributori indicizzata per questo repository
Valutazione
Questa issue non è ancora stata valutata.