Skip to content
This repository has been archived by the owner on Feb 16, 2023. It is now read-only.

Commit

Permalink
Hide description if empty
Browse files Browse the repository at this point in the history
Otherwise an empty pair of brackets if shown, which looks weird.
  • Loading branch information
jpcoenen committed Jun 9, 2020
1 parent 49f23fb commit e9553d3
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion internals/secrethub/service_gcp_init.go
Original file line number Diff line number Diff line change
Expand Up @@ -201,9 +201,13 @@ func (l *gcpServiceAccountOptionLister) Options() ([]ui.Option, bool, error) {

options := make([]ui.Option, len(resp.Accounts))
for i, account := range resp.Accounts {
display := account.Email
if account.Description != "" {
display += " (" + account.Description + ")"
}
options[i] = ui.Option{
Value: account.Email,
Display: fmt.Sprintf("%s (%s)", account.Email, account.Description),
Display: display,
}
}

Expand Down

0 comments on commit e9553d3

Please sign in to comment.