/*
FindHost
Return a Host reference that matches the argument.
*/
FindHost
Return a Host reference that matches the argument.
/ * FindHost Return a Host reference that matches the argument . * /
func (cfg *Config) FindHost(hostname string) *Host {
	if cfg.Root.Hosts == nil {
		return nil
	}
	for i := range cfg.Root.Hosts {
		host := &cfg.Root.Hosts[i]
		if host.Name == hostname {
			return host
		}
	}
	for i := range cfg.Root.Hosts {
		host := &cfg.Root.Hosts[i]
		if host.RestHostname == hostname {
			return host
		}
	}
	return nil
}
func ( cfg * Config ) FindHost ( hostname string ) * Host { if cfg . Root . Hosts == nil { return nil } for i := range cfg . Root . Hosts { host := & cfg . Root . Hosts [ i ] if host . Name == hostname { return host } } for i := range cfg . Root . Hosts { host := & cfg . Root . Hosts [ i ] if host . RestHostname == hostname { return host } } return nil }
FindHost
Return a Host reference that matches the argument.
FindHost Return a Host reference that matches the argument .
// range returns copies: https://stackoverflow.com/q/20185511 // range returns copies: https://stackoverflow.com/q/20185511