/*
GetActiveHost
Return the URL that will be used based on the configuration.

The local configuration has a 'host' field in its 'main' section. That host
points to a section in the root configuration. We return the rest_hostname of
that section. The fallback value is `https://rest.api.transifex.com` */
GetActiveHost
Return the URL that will be used based on the configuration.

The local configuration has a 'host' field in its 'main' section. That host
points to a section in the root configuration. We return the rest_hostname of
that section.
/ * GetActiveHost Return the URL that will be used based on the configuration . The local configuration has a ' host ' field in its ' main ' section . That host points to a section in the root configuration . We return the rest_hostname of that section . The fallback value is ` https : // rest . api . transifex . com ` * /
func (cfg *Config) GetActiveHost() *Host {
	if cfg.Root.Hosts == nil || len(cfg.Root.Hosts) == 0 ||
		cfg.Local == nil {
		return nil
	}
	activeHostName := cfg.Local.Host
	for i := range cfg.Root.Hosts {
		host := &cfg.Root.Hosts[i]
		if host.Name == activeHostName {
			return host
		}
	}
	return nil
}
func ( cfg * Config ) GetActiveHost ( ) * Host { if cfg . Root . Hosts == nil || len ( cfg . Root . Hosts ) == 0 || cfg . Local == nil { return nil } activeHostName := cfg . Local . Host for i := range cfg . Root . Hosts { host := & cfg . Root . Hosts [ i ] if host . Name == activeHostName { return host } } return nil }
GetActiveHost
Return the URL that will be used based on the configuration.
GetActiveHost Return the URL that will be used based on the configuration .