Sobes.tech
Junior — Middle

In which place or file are environment variables usually specified for a project?

sobes.tech AI

Answer from AI

Environment variables for a project are usually specified in a file named .env located in the root of the project. This file contains key-value pairs, for example:

DATABASE_URL=postgres://user:password@localhost:5432/dbname
PORT=8080
DEBUG=true

In Go projects, libraries such as github.com/joho/godotenv are often used to load these variables. Environment variables can also be set directly in the operating system's environment settings or in container configurations (Docker, Kubernetes).