mirror of
https://gitee.com/johng/gf
synced 2026-07-04 21:03:13 +08:00
refactor: remove unnecessary code in method getListenAddress of Server
This commit is contained in:
@ -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)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user