Skip to content

Commit

Permalink
don't panic if .env is not found
Browse files Browse the repository at this point in the history
  • Loading branch information
Sledro committed Nov 1, 2024
1 parent d50451a commit e7c9f03
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions cmd/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,6 @@ import (
var Version = "development"

func main() {
err := godotenv.Load()
if err != nil {
log.Fatal("Error loading .env file")
}

// create a new logger
Logger := slog.New(tint.NewHandler(os.Stderr, nil))

Expand All @@ -45,6 +40,11 @@ func main() {
"Operating System", runtime.GOOS,
"Architecture", runtime.GOARCH)

err := godotenv.Load()
if err != nil {
Logger.Warn(".env file not found, will attempt to use environment variables from system")
}

llDefaultStartBlock, err := strconv.ParseUint(os.Getenv("LL_DEFAULT_START_BLOCK"), 10, 64)
if err != nil {
log.Fatalf("failed to parse LL_DEFAULT_START_BLOCK: %v", err)
Expand Down

0 comments on commit e7c9f03

Please sign in to comment.