github.com/Thanhphan1147/cloudfoundry-cli@v7.1.0+incompatible/command/translatableerror/domain_not_found_error.go (about) 1 package translatableerror 2 3 type DomainNotFoundError struct { 4 Name string 5 GUID string 6 } 7 8 func (e DomainNotFoundError) Error() string { 9 switch { 10 case e.Name != "": 11 return "Domain '{{.DomainName}}' not found." 12 case e.GUID != "": 13 return "Domain with GUID '{{.DomainGUID}}' not found." 14 default: 15 return "Domain not found." 16 } 17 } 18 19 func (e DomainNotFoundError) Translate(translate func(string, ...interface{}) string) string { 20 return translate(e.Error(), map[string]interface{}{ 21 "DomainName": e.Name, 22 "DomainGUID": e.GUID, 23 }) 24 }