The script.Exec contains this code
args, err := shell.Fields(cmdLine, nil)
if err != nil {
return err
}
that already evaluates the env variables, but nil is passed in. So the variables are evaluated as empty string.
https://go.dev/play/p/P73IM0NLNBv
Or am I using it wrong?
The
script.Execcontains this codethat already evaluates the env variables, but
nilis passed in. So the variables are evaluated as empty string.https://go.dev/play/p/P73IM0NLNBv
Or am I using it wrong?