github.com/cloudfoundry/cli@v7.1.0+incompatible/actor/actionerror/ambiguous_user_error.go (about) 1 package actionerror 2 3 import ( 4 "fmt" 5 "sort" 6 "strings" 7 ) 8 9 type AmbiguousUserError struct { 10 Username string 11 Origins []string 12 } 13 14 func (e AmbiguousUserError) Error() string { 15 sort.Strings(e.Origins) 16 origins := strings.Join(e.Origins, ", ") 17 return fmt.Sprintf( 18 "Ambiguous user. User with username '%s' exists in the following origins: %s. Specify an origin to disambiguate.", 19 e.Username, 20 origins, 21 ) 22 }