Skip to content

Commit 85a1a5f

Browse files
committed
chore: add funcorder linter
1 parent f32fcd7 commit 85a1a5f

File tree

2 files changed

+9
-6
lines changed

2 files changed

+9
-6
lines changed

.golangci.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,9 @@ linters:
6262
# Reports uses of functions with replacement inside the testing package.
6363
- usetesting
6464

65+
# Make sure exported struct functions are declared before unexported ones
66+
- funcorder
67+
6568
settings:
6669
revive:
6770
rules:

internal/spinner/spinner.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,6 @@ func New(out io.Writer) *Spinner {
2424
return s
2525
}
2626

27-
// print prints the given string to the output, ensuring consistent width.
28-
func (s *Spinner) print(str string) {
29-
s.maxChars = max(s.maxChars, len(str))
30-
fmt.Fprintf(s.out, "%*s", s.maxChars, str)
31-
}
32-
3327
// Start begins the spinner animation with the initial message.
3428
func (s *Spinner) Start(ctx context.Context, str string) {
3529
s.print(str)
@@ -63,3 +57,9 @@ func (s *Spinner) Done(format string, args ...any) {
6357
close(s.done)
6458
close(s.tick)
6559
}
60+
61+
// print prints the given string to the output, ensuring consistent width.
62+
func (s *Spinner) print(str string) {
63+
s.maxChars = max(s.maxChars, len(str))
64+
fmt.Fprintf(s.out, "%*s", s.maxChars, str)
65+
}

0 commit comments

Comments
 (0)