Skip to content

Commit

Permalink
Remove dead code and make one-line functions more readable
Browse files Browse the repository at this point in the history
  • Loading branch information
theckman committed Dec 29, 2019
1 parent e9409f5 commit f4b66f6
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions spinner.go
Original file line number Diff line number Diff line change
Expand Up @@ -364,7 +364,6 @@ func (s *Spinner) painter(cancel, sig chan struct{}) {
s.mu.Lock()

c := s.chars[s.index]
// mw := s.maxWidth
s.index++

if s.index == len(s.chars) {
Expand Down Expand Up @@ -446,14 +445,20 @@ func (s *Spinner) Delay(d time.Duration) error {
}

// Prefix updates the Prefix before the spinner character.
func (s *Spinner) Prefix(prefix string) { s.prefix.Store(prefix) }
func (s *Spinner) Prefix(prefix string) {
s.prefix.Store(prefix)
}

// Suffix updates the Suffix after the spinner character. It's recommended that
// this start with an empty space.
func (s *Spinner) Suffix(suffix string) { s.suffix.Store(suffix) }
func (s *Spinner) Suffix(suffix string) {
s.suffix.Store(suffix)
}

// Message updates the Message displayed after he suffix.
func (s *Spinner) Message(message string) { s.message.Store(message) }
func (s *Spinner) Message(message string) {
s.message.Store(message)
}

// Colors updates the github.com/fatih/colors for printing the spinner line.
// ColorAll config parameter controls whether only the spinner character is
Expand Down Expand Up @@ -525,6 +530,5 @@ func (s *Spinner) Reverse() {
}
}

func int64Ptr(i int64) *int64 { return &i }

func int64Ptr(i int64) *int64 { return &i }
func uint32Ptr(u uint32) *uint32 { return &u }

0 comments on commit f4b66f6

Please sign in to comment.