Skip to content

Conversation

@maishivamhoo123
Copy link

Summary

This PR adds optional support for loading environment variables from a .env file to improve local development experience.

Changes

  • Load .env file at startup if it exists (ignored if missing)
  • Add .env.example with empty default values
  • Add .env to .gitignore

Backward Compatibility

  • No behavior change if .env is not present
  • Existing OS environment variables continue to work
  • Production and container-based deployments are unaffected

Related Issue

Closes #1450

@LinkinStars
Copy link
Member

@maishivamhoo123 You submitted language and configuration files that should not have been submitted.

@LinkinStars LinkinStars self-assigned this Dec 25, 2025
@maishivamhoo123
Copy link
Author

Sorry sir for the confusion. I won’t repeat this again.
Just to confirm, I should add only the following files:

main.go

.env.example

.gitignore

README.md

go.mod
@LinkinStars Sir Please let me know if this is correct.
Thank you for your guidance, sir.

@LinkinStars
Copy link
Member

Sorry sir for the confusion. I won’t repeat this again. Just to confirm, I should add only the following files:

main.go

.env.example

.gitignore

README.md

go.mod @LinkinStars Sir Please let me know if this is correct. Thank you for your guidance, sir.

@maishivamhoo123 I think we can skip modifying README.md. We can add this instructions to https://answer.apache.org/docs/env

@maishivamhoo123
Copy link
Author

maishivamhoo123 commented Dec 25, 2025

Understood, @LinkinStars sir.
So instead of modifying README.md, I should add the relevant instructions to the documentation at https://answer.apache.org/docs/env
.
Thank you for your guidance.

@maishivamhoo123
Copy link
Author

@LinkinStars Sir,
I hope this PR looks good now. If there are any remaining issues or further improvements needed, please let me know—I’ll be happy to address them.

Thank you for your guidance .

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.

Can we add .env to to better facilitate everyone in setting env

2 participants