MCPcopy
hub / github.com/rs/zerolog / getHost

Function getHost

hlog/hlog.go:94–104  ·  view source on GitHub ↗
(hostPort string)

Source from the content-addressed store, hash-verified

92}
93
94func getHost(hostPort string) string {
95 if hostPort == "" {
96 return ""
97 }
98
99 host, _, err := net.SplitHostPort(hostPort)
100 if err != nil {
101 return hostPort
102 }
103 return host
104}
105
106// RemoteIPHandler is similar to RemoteAddrHandler, but logs only
107// an IP, not a port.

Callers 3

RemoteIPHandlerFunction · 0.85
HostHandlerFunction · 0.85
TestGetHostFunction · 0.85

Calls

no outgoing calls

Tested by 1

TestGetHostFunction · 0.68