16 lines
248 B
Go
16 lines
248 B
Go
package main
|
|
|
|
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
|
|
}
|