From b122cbb65249a6a2fad6db1b373f9eabf39a894d Mon Sep 17 00:00:00 2001 From: Slavasil Date: Tue, 27 Oct 2026 09:25:52 +0300 Subject: [PATCH] add dotenv in go server --- game-server/cmd/server/main.go | 2 ++ game-server/go.mod | 2 ++ game-server/go.sum | 2 ++ 3 files changed, 6 insertions(+) diff --git a/game-server/cmd/server/main.go b/game-server/cmd/server/main.go index 140d4a3..397929b 100644 --- a/game-server/cmd/server/main.go +++ b/game-server/cmd/server/main.go @@ -13,6 +13,8 @@ import ( "github.com/ruby-sea-battle/game-server/internal/config" "github.com/ruby-sea-battle/game-server/internal/game" "github.com/ruby-sea-battle/game-server/internal/ws" + + _ "github.com/joho/godotenv/autoload" ) func main() { diff --git a/game-server/go.mod b/game-server/go.mod index 6b8b9bf..42778d0 100644 --- a/game-server/go.mod +++ b/game-server/go.mod @@ -6,3 +6,5 @@ require ( github.com/coder/websocket v1.8.15 github.com/golang-jwt/jwt/v5 v5.3.1 ) + +require github.com/joho/godotenv v1.5.1 // indirect diff --git a/game-server/go.sum b/game-server/go.sum index c6bffb7..6911a17 100644 --- a/game-server/go.sum +++ b/game-server/go.sum @@ -2,3 +2,5 @@ github.com/coder/websocket v1.8.15 h1:6B2JPeOGlpff2Uz6vOEH1Vzpi0iUz20A+lPVhPHtNU github.com/coder/websocket v1.8.15/go.mod h1:NX3SzP+inril6yawo5CQXx8+fk145lPDC6pumgx0mVg= github.com/golang-jwt/jwt/v5 v5.3.1 h1:kYf81DTWFe7t+1VvL7eS+jKFVWaUnK9cB1qbwn63YCY= github.com/golang-jwt/jwt/v5 v5.3.1/go.mod h1:fxCRLWMO43lRc8nhHWY6LGqRcf+1gQWArsqaEUEa5bE= +github.com/joho/godotenv v1.5.1 h1:7eLL/+HRGLY0ldzfGMeQkb7vMd0as4CfYvUVzLqw0N0= +github.com/joho/godotenv v1.5.1/go.mod h1:f4LDr5Voq0i2e/R5DDNOoa2zzDfwtkZa6DnEwAbqwq4=