refactor: remove unnecessary code in method getListenAddress of Server

This commit is contained in:
Macrow
2022-03-20 10:17:44 +08:00
parent ad202ea735
commit 147348e0d1

View File

@ -262,12 +262,6 @@ func (s *Server) getListenAddress() string {
} else {
port = gconv.Int(array[0])
}
if s.config.Listeners != nil {
for _, v := range s.config.Listeners {
portArray := gstr.SplitAndTrim(v.Addr().String(), ":")
port = gconv.Int(portArray[len(portArray)-1])
}
}
return fmt.Sprintf(`http://%s:%d`, host, port)
}