Skip to content

Commit

Permalink
MINOR: env: add option to load environment variables from .env file
Browse files Browse the repository at this point in the history
  • Loading branch information
oktalz authored and mjuraga committed Aug 8, 2024
1 parent dab0faa commit 1a7aaea
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
7 changes: 4 additions & 3 deletions cmd/dataplaneapi/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,19 +23,19 @@ import (
"path/filepath"
"syscall"

_ "github.com/KimMachineGun/automemlimit"
loads "github.com/go-openapi/loads"
"github.com/go-openapi/runtime"
"github.com/go-openapi/runtime/security"
flags "github.com/jessevdk/go-flags"

_ "github.com/KimMachineGun/automemlimit"
"github.com/haproxytech/client-native/v6/models"
"github.com/haproxytech/client-native/v6/storage"
"github.com/haproxytech/dataplaneapi"
"github.com/haproxytech/dataplaneapi/configuration"
"github.com/haproxytech/dataplaneapi/log"
"github.com/haproxytech/dataplaneapi/operations"
socket_runtime "github.com/haproxytech/dataplaneapi/runtime"
flags "github.com/jessevdk/go-flags"
"github.com/joho/godotenv"
_ "go.uber.org/automaxprocs"
)

Expand All @@ -59,6 +59,7 @@ var cliOptions struct {
}

func main() {
_ = godotenv.Load()
cancelDebugServer := startRuntimeDebugServer()

cfg := configuration.Get()
Expand Down
1 change: 1 addition & 0 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ require (
github.com/google/uuid v1.6.0
github.com/haproxytech/client-native/v6 v6.0.0-20240806205348-3c6c7501d445
github.com/jessevdk/go-flags v1.5.0
github.com/joho/godotenv v1.5.1
github.com/json-iterator/go v1.1.12
github.com/kr/pretty v0.3.1
github.com/lestrrat-go/apache-logformat v0.0.0-20210106032603-24d066f940f8
Expand Down
2 changes: 2 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,8 @@ github.com/jmespath/go-jmespath v0.4.0 h1:BEgLn5cpjn8UN1mAw4NjwDrS35OdebyEtFe+9Y
github.com/jmespath/go-jmespath v0.4.0/go.mod h1:T8mJZnbsbmF+m6zOOFylbeCJqk5+pHWvzYPziyZiYoo=
github.com/jmespath/go-jmespath/internal/testify v1.5.1 h1:shLQSRRSCCPj3f2gpwzGwWFoC7ycTf1rcQZHOlsJ6N8=
github.com/jmespath/go-jmespath/internal/testify v1.5.1/go.mod h1:L3OGu8Wl2/fWfCI6z80xFu9LTZmf1ZRjMHUOPmWr69U=
github.com/joho/godotenv v1.5.1 h1:7eLL/+HRGLY0ldzfGMeQkb7vMd0as4CfYvUVzLqw0N0=
github.com/joho/godotenv v1.5.1/go.mod h1:f4LDr5Voq0i2e/R5DDNOoa2zzDfwtkZa6DnEwAbqwq4=
github.com/josharian/intern v1.0.0 h1:vlS4z54oSdjm0bgjRigI+G1HpF+tI+9rE5LLzOg8HmY=
github.com/josharian/intern v1.0.0/go.mod h1:5DoeVV0s6jJacbCEi61lwdGj/aVlrQvzHFFd8Hwg//Y=
github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnrnM=
Expand Down

0 comments on commit 1a7aaea

Please sign in to comment.