From 29b45c3fc8d28379846b94a92f0ae2f05361b07f Mon Sep 17 00:00:00 2001 From: natserract Date: Mon, 11 Nov 2024 20:34:30 +0800 Subject: [PATCH] let it pass env load on railway --- server/cmd/app/main.go | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/server/cmd/app/main.go b/server/cmd/app/main.go index 25a094c..16dff51 100644 --- a/server/cmd/app/main.go +++ b/server/cmd/app/main.go @@ -28,11 +28,9 @@ func main() { gob.Register([]interface{}{}) gob.Register(map[string]interface{}{}) - err := godotenv.Load() - if err != nil { - fmt.Fprintf(os.Stderr, "Failed to load .env %v\n", err) - os.Exit(1) - } + // Railway doesn't need to load environment variables from an .env file, that's only for local development. + // Do nothing + godotenv.Load() cfg := config.GetConfig()