|
@@ -10,7 +10,8 @@ import (
|
|
|
|
|
|
// nolint:gosec
|
|
// nolint:gosec
|
|
const (
|
|
const (
|
|
- envPath = "../../config/.env"
|
|
|
|
|
|
+ envPathVar = "ENV_PATH"
|
|
|
|
+ envPath = "../../config/.env"
|
|
|
|
|
|
appPortEnv = "APP_PORT"
|
|
appPortEnv = "APP_PORT"
|
|
|
|
|
|
@@ -58,6 +59,11 @@ type env struct {
|
|
func Init() (interfaces.IEnv, error) {
|
|
func Init() (interfaces.IEnv, error) {
|
|
res := &env{}
|
|
res := &env{}
|
|
|
|
|
|
|
|
+ path := os.Getenv(envPathVar)
|
|
|
|
+ if path == "" {
|
|
|
|
+ path = envPath
|
|
|
|
+ }
|
|
|
|
+
|
|
file, err := os.Open(envPath)
|
|
file, err := os.Open(envPath)
|
|
if err != nil {
|
|
if err != nil {
|
|
return nil, err
|
|
return nil, err
|