github.com/wanddynosios/cli/v8@v8.7.9-0.20240221182337-1a92e3a7017f/api/cloudcontroller/ccerror/service_offering_name_ambiguity_error.go (about) 1 package ccerror 2 3 import ( 4 "fmt" 5 "strings" 6 ) 7 8 type ServiceOfferingNameAmbiguityError struct { 9 ServiceOfferingName string 10 ServiceBrokerNames []string 11 } 12 13 func (e ServiceOfferingNameAmbiguityError) Error() string { 14 const msg = "Service '%s' is provided by multiple service brokers%s" 15 switch len(e.ServiceBrokerNames) { 16 case 0: 17 return fmt.Sprintf(msg, e.ServiceOfferingName, ".") 18 default: 19 return fmt.Sprintf(msg, e.ServiceOfferingName, ": "+strings.Join(e.ServiceBrokerNames, ", ")) 20 } 21 }