MCPcopy Create free account
hub / github.com/Mister-leo/fssh / resolveIPName

Function resolveIPName

cmd/fssh/shell.go:374–382  ·  view source on GitHub ↗
(target string)

Source from the content-addressed store, hash-verified

372}
373
374func resolveIPName(target string) string {
375 if target == "" { return "" }
376 ips, err := net.LookupIP(target)
377 if err != nil || len(ips) == 0 { return "" }
378 for _, ip := range ips {
379 if ip.To4() != nil { return ip.String() }
380 }
381 return ips[0].String()
382}
383
384func displayHostname(hi sshconfig.HostInfo) string {
385 if hi.Hostname != "" { return hi.Hostname }

Callers 3

cmdInfoFunction · 0.85
reloadHostsFunction · 0.85
runShellFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected