Re: [go-nuts] Set environment variables from command line argument

2020-05-09 Thread Amarjeet Anand
It worked. Exactly what I was looking for. Thanks a lot. On Sun, 10 May, 2020, 7:44 AM Kurtis Rader, wrote: > On Sat, May 9, 2020 at 7:04 PM Amarjeet Anand > wrote: > >> Is it possible to set environment variables while running my app like... >> >> *go run -env_var1="val1" main.go* >> > > Is th

Re: [go-nuts] Set environment variables from command line argument

2020-05-09 Thread Kurtis Rader
On Sat, May 9, 2020 at 7:04 PM Amarjeet Anand 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

[go-nuts] Set environment variables from command line argument

2020-05-09 Thread Amarjeet Anand
Hi Is it possible to set environment variables while running my app like... *go run -env_var1="val1" main.go* And then access *env_var* value as - *os.Getenv("env_var1")* I know, we can access command line arguments in go and set it manually as environment variables. But am asking if there i