Fix ineffectual assignment in spinner example

This commit is contained in:
Christian Muehlhaeuser 2021-03-12 02:07:50 +01:00
parent b6c7f93d9a
commit f981b991c0
1 changed files with 2 additions and 1 deletions

View File

@ -86,13 +86,14 @@ func (m *model) resetSpinner() {
} }
func (m model) View() (s string) { func (m model) View() (s string) {
gap := " " var gap string
switch m.index { switch m.index {
case 1: case 1:
gap = "" gap = ""
default: default:
gap = " " gap = " "
} }
s += fmt.Sprintf("\n %s%s%s\n\n", m.spinner.View(), gap, textStyle("Spinning...")) s += fmt.Sprintf("\n %s%s%s\n\n", m.spinner.View(), gap, textStyle("Spinning..."))
s += helpStyle("h/l, ←/→: change spinner • q: exit\n") s += helpStyle("h/l, ←/→: change spinner • q: exit\n")
return return