Use the godotenv autoload package
mainFor the simplest integration, you can import the autoload package. This will automatically read and load the .env file into your environment upon import, requiring no additional function calls.
import _ "github.com/joho/godotenv/autoload"