Skip to content

Commit

Permalink
skip dotenv if env is set
Browse files Browse the repository at this point in the history
  • Loading branch information
bgentry committed May 3, 2024
1 parent 8f3a87b commit cd5fd0c
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,10 @@ var logger *slog.Logger //nolint:gochecknoglobals

func main() {
ctx := context.Background()
if err := godotenv.Load(); err != nil {
log.Fatal("Error loading .env file")
if os.Getenv("SKIP_DOTENV") != "1" {
if err := godotenv.Load(); err != nil {
log.Fatal("Error loading .env file")
}
}
logger = slog.New(slog.NewTextHandler(os.Stdout, nil))

Expand Down

0 comments on commit cd5fd0c

Please sign in to comment.