go: fix setting port from config
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
parent
7a877b01bb
commit
e7849b5443
@ -91,6 +91,8 @@ func (s *Settings) Consolidate(conf *config.Config, host *string, port *int, dev
|
|||||||
log.Debug("parsing config values")
|
log.Debug("parsing config values")
|
||||||
|
|
||||||
if p := conf.Port; p > 0 && p < 65536 {
|
if p := conf.Port; p > 0 && p < 65536 {
|
||||||
|
s.SetPort(conf.Port)
|
||||||
|
} else {
|
||||||
log.Warnf("port '%d', outside of bounds, setting a default of %d/tcp", p, defaultPort)
|
log.Warnf("port '%d', outside of bounds, setting a default of %d/tcp", p, defaultPort)
|
||||||
s.SetPort(defaultPort)
|
s.SetPort(defaultPort)
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user