问题
Could anyone say me how to export environment vars before running GoLand Run" with such command:
source .env
.env file:
export MY_VAR="Some value"
Yes I know, that I can define all vars in run config using "Environment variables", but it is too, em... bad solution, as I store all vars in bash file.
回答1:
There is a plugin built for this purpose. It can import.env
,.json
and .yaml
.
https://plugins.jetbrains.com/plugin/7861-envfile
回答2:
You can go to Tools | Create command line launcher... and then start GoLand from the command line, which will then inherit those environment variables and pass it to your run configurations.
At the moment this feature is not supported, you can request it on the issue tracker.
来源:https://stackoverflow.com/questions/48863021/goland-environment-vars-in-env-file