go: fix setting port from config
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
surtur 2023-08-20 23:01:27 +02:00
parent 7a877b01bb
commit e7849b5443
Signed by: wanderer
SSH Key Fingerprint: SHA256:MdCZyJ2sHLltrLBp0xQO0O1qTW9BT/xl5nXkDvhlMCI

View File

@ -91,6 +91,8 @@ func (s *Settings) Consolidate(conf *config.Config, host *string, port *int, dev
log.Debug("parsing config values")
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)
s.SetPort(defaultPort)
}