package internal import "fmt" type Registry struct { Hostname string Port int } func (registry Registry) String() string { if registry.Port != 0 { return fmt.Sprintf("%s:%d", registry.Hostname, registry.Port) } return registry.Hostname }