On Sat, May 9, 2020 at 7:04 PM Amarjeet Anand <sarvmar...@gmail.com> wrote:

> Is it possible to set environment variables while running my app like...
>
> *go run -env_var1="val1" main.go*
>

Is there some reason you can't simply do this

    env_var1=val1 go run main.go

Or this

    env env_var1=val1 go run main.go

if your shell doesn't support the POSIX shell syntax for temporary
modification of the environment a command inherits?

-- 
Kurtis Rader
Caretaker of the exceptional canines Junior and Hank

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/CABx2%3DD9asJ-jJSxPp6aaxnV83RtiQQgd7pca9e-vCD3EBaV%2B1g%40mail.gmail.com.

Reply via email to