github.com/ablease/cli@v6.37.1-0.20180613014814-3adbb7d7fb19+incompatible/command/translatableerror/service_instance_not_found_error.go (about) 1 package translatableerror 2 3 type ServiceInstanceNotFoundError struct { 4 GUID string 5 Name string 6 } 7 8 func (e ServiceInstanceNotFoundError) Error() string { 9 if e.Name == "" { 10 return "Service instance (GUID: {{.GUID}}) not found" 11 } 12 return "Service instance {{.ServiceInstance}} not found" 13 } 14 15 func (e ServiceInstanceNotFoundError) Translate(translate func(string, ...interface{}) string) string { 16 return translate(e.Error(), map[string]interface{}{ 17 "GUID": e.GUID, 18 "ServiceInstance": e.Name, 19 }) 20 }