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
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
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