Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: run go serve load env use Overload #434

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

weedge
Copy link

@weedge weedge commented Nov 23, 2024

No description provided.

@wangyoucao577
Copy link
Collaborator

What's the benefit of this change?

@weedge
Copy link
Author

weedge commented Nov 25, 2024

change .env file in project root dir in docker container ; if environment variables has defined in sys user mode, can't to load those in the .env file; just use environment variables which defined in .env file.

@wangyoucao577
Copy link
Collaborator

change .env file in project root dir in docker container ; if environment variables has defined in sys user mode, can't to load those in the .env file; just use environment variables which defined in .env file.

Does source .env work for you?

@weedge
Copy link
Author

weedge commented Nov 27, 2024

@wangyoucao577 yes, is work, need set vars in .env

AGORA_APP_ID=***
AGORA_APP_CERTIFICATE=***

if not set those env, use user mod defined vars $AGORA_APP_CERTIFICATE,
if vars both in .env and defined vars; so want use Overload use vars in .env; :)

@wangyoucao577
Copy link
Collaborator

@wangyoucao577 yes, is work, need set vars in .env

AGORA_APP_ID=***
AGORA_APP_CERTIFICATE=***

if not set those env, use user mod defined vars $AGORA_APP_CERTIFICATE, if vars both in .env and defined vars; so want use Overload use vars in .env; :)

OK. So use overload to force to use .env seems a little bit no sense here. export XXX should has higher priority than .env, which is more intuitive. On the other hand, the godotenv also warns that use the Overload if needed with caution. So use Overload instead of Load here may not a good choice.

@weedge
Copy link
Author

weedge commented Nov 29, 2024

..... but just change the Secrets(such as api key, app token) in .env file, don't to use in user mode defined vars. unsafe.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants