diff --git a/cmd/config/config.go b/cmd/config/config.go index 1dcf92b..3dcaa83 100644 --- a/cmd/config/config.go +++ b/cmd/config/config.go @@ -1,6 +1,7 @@ package config import ( + "fmt" "github.com/nabbat/23_kogorta_shotener/internal/envirements" "github.com/nabbat/23_kogorta_shotener/internal/flags" ) @@ -27,6 +28,6 @@ func SetEnv() *Config { } else { c.ResultURL = fl.ResultURL } - + fmt.Println(c) return c } diff --git a/internal/envirements/envirements.go b/internal/envirements/envirements.go index 4426892..5628199 100644 --- a/internal/envirements/envirements.go +++ b/internal/envirements/envirements.go @@ -16,7 +16,7 @@ func ParseEnv() *EnvConfig { env.EnvRunAddr = os.Getenv("RUN_ADDR") env.EnvResultURL = os.Getenv("SERVER_ADDRESS") // парсим переданные серверу аргументы в зарегистрированные переменные - if !strings.HasPrefix(env.EnvResultURL, "http://") { + if !strings.HasPrefix(env.EnvResultURL, "http://") && env.EnvResultURL != "" { env.EnvResultURL = "http://" + env.EnvResultURL } return env