Skip to content

Commit

Permalink
minimize print statements by bundling info into str
Browse files Browse the repository at this point in the history
  • Loading branch information
jmcook1186 committed Nov 7, 2022
1 parent 56e46c3 commit adc44ff
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions signer/core/cliui.go
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,7 @@ func (ui *CommandlineUI) ShowAccounts() string {
resp = "No accounts known to Clef"
} else {
// account info to string for nicer printing
var addresses string = ""
var addresses string = "\nAccounts known to Clef:\n"
for i, account := range accounts {
// concat string to avoid repeating "INFO" on terminal
addresses += fmt.Sprintf("Account %v: %s at %s\n", i, account.Address, account.URL)
Expand All @@ -265,9 +265,8 @@ func (ui *CommandlineUI) ShowAccounts() string {

func (ui *CommandlineUI) OnSignerStartup(info StartupInfo) {
addresses := ui.ShowAccounts()
fmt.Print("Accounts known to Clef:\n\n")
fmt.Printf("%s", addresses)
fmt.Printf("------- Signer info -------\n")
fmt.Printf("\n------- Signer info -------\n")
for k, v := range info.Info {
fmt.Printf("* %v : %v\n", k, v)
}
Expand Down

0 comments on commit adc44ff

Please sign in to comment.