Skip to content

Commit

Permalink
iter5 check environments
Browse files Browse the repository at this point in the history
  • Loading branch information
ByteDSM committed Oct 10, 2023
1 parent 44f17b7 commit 49684d6
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion cmd/config/config.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package config

import (
"fmt"
"github.com/nabbat/23_kogorta_shotener/internal/envirements"
"github.com/nabbat/23_kogorta_shotener/internal/flags"
)
Expand All @@ -27,6 +28,6 @@ func SetEnv() *Config {
} else {
c.ResultURL = fl.ResultURL
}

fmt.Println(c)
return c
}
2 changes: 1 addition & 1 deletion internal/envirements/envirements.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 49684d6

Please sign in to comment.