-
Configure environment variable
ENVIRONMENT=<SCOPE>
outside.env
file-
Example in sh
ENVIRONMENT=local \ go run ./cmd/api/main.go
-
-
Copy
local.env.example
file and change name for<ENVIRONMENT>.env
and add environment variables- Environments:
TEST
,LOCAL
orPRODUCTION
- Environments:
-
Create DB schema
appointments
before start the project
- When adding a new environment variable to
.env
file, add the same to the.env.example
file with a dummy value.
-
add into file
./.vscode/launch.sh
:{ // Use IntelliSense to learn about possible attributes. // Hover to view descriptions of existing attributes. // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 "version": "0.2.0", "configurations": [ { "name": "Launch Package", "type": "go", "request": "launch", "mode": "auto", "program": "${workspaceFolder}/cmd/api/main.go", "env": { "ENVIRONMENT": "local" } } ] }