Skip to content

Commit 63f3ec4

Browse files
committed
fix linter issues
1 parent 93d774a commit 63f3ec4

14 files changed

Lines changed: 63 additions & 59 deletions

File tree

internal/digest/event.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
package digest
22

33
// EventType defines the type of the SSE event.
4-
type EventType int
4+
type EventType int //nolint:recvcheck
55

66
const (
77
// EventTypeConfig mean "config" SSE event.

internal/digest/format.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ func formatDefault(value float64) string {
125125
return fmt.Sprintf("%.*f%s", prec, value/float64(unit), suffix)
126126
}
127127

128-
type countUnit int
128+
type countUnit int //nolint:recvcheck
129129

130130
const (
131131
countUnitOne countUnit = 1
@@ -139,7 +139,7 @@ const (
139139

140140
//go:generate go run github.com/dmarkham/enumer@latest -text -transform lower -trimprefix countUnit -type countUnit
141141

142-
type dataUnit int
142+
type dataUnit int //nolint:recvcheck
143143

144144
const (
145145
dataUnitB dataUnit = 1

internal/digest/level.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
package digest
22

33
// Level defines log and alert levels.
4-
type Level int
4+
type Level int //nolint:recvcheck
55

66
const (
77
// None means regular.

internal/digest/metric.go

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,20 @@
11
package digest
22

33
// A MetricType specifies the type of a metric.
4-
type MetricType int
4+
type MetricType int //nolint:recvcheck
55

66
//go:generate go run github.com/dmarkham/enumer@latest -text -json -transform lower -trimprefix MetricType -type MetricType
77

88
// Possible values for MetricType.
99
const (
10-
MetricTypeCounter MetricType = iota // A counter that sums its data points
11-
MetricTypeGauge // A gauge that displays the latest value
12-
MetricTypeTrend // A trend, min/max/avg/med are interesting
13-
MetricTypeRate // A rate, displays % of values that aren't 0
10+
// MetricTypeCounter is a counter that sums its data points.
11+
MetricTypeCounter MetricType = iota
12+
// MetricTypeGauge is a gauge that displays the latest value.
13+
MetricTypeGauge
14+
// MetricTypeTrend is a trend, min/max/avg/med are interesting.
15+
MetricTypeTrend
16+
// MetricTypeRate is a rate, displays % of values that aren't 0.
17+
MetricTypeRate
1418
)
1519

1620
//nolint:gochecknoglobals
@@ -38,7 +42,7 @@ func (md MetricType) Aggregates() []string {
3842
}
3943

4044
// ValueType holds the type of values a metric contains.
41-
type ValueType int
45+
type ValueType int //nolint:recvcheck
4246

4347
//go:generate go run github.com/dmarkham/enumer@latest -text -json -transform lower -trimprefix ValueType -type ValueType
4448

internal/digest/state.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
package digest
22

33
// State defines the SSE stream/connection states.
4-
type State int
4+
type State int //nolint:recvcheck
55

66
const (
77
// StateWaiting means waiting for data.

internal/ui/chart/chart.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,12 @@ type Model struct {
2929
}
3030

3131
// Init implements tea.Model.
32-
func (m Model) Init() tea.Cmd {
32+
func (m *Model) Init() tea.Cmd {
3333
return nil
3434
}
3535

3636
// Update implements tea.Model.
37-
func (m Model) Update(msg tea.Msg) (tea.Model, tea.Cmd) { //nolint:cyclop
37+
func (m *Model) Update(msg tea.Msg) (tea.Model, tea.Cmd) { //nolint:cyclop
3838
switch msg := msg.(type) {
3939
case tea.KeyMsg:
4040
switch msg.String() {
@@ -70,7 +70,7 @@ func (m Model) Update(msg tea.Msg) (tea.Model, tea.Cmd) { //nolint:cyclop
7070
}
7171

7272
// View implements tea.Model.
73-
func (m Model) View() string {
73+
func (m *Model) View() string {
7474
if len(m.data) < 1 || len(m.data[0]) < 1 {
7575
return ""
7676
}
@@ -102,14 +102,14 @@ func (m Model) View() string {
102102
}
103103

104104
// New creates new chart instance.
105-
func New(digest *digest.Digester, series []*Serie) Model {
105+
func New(digest *digest.Digester, series []*Serie) *Model {
106106
m := Model{
107107
digest: digest,
108108
series: series,
109109
details: len(series) - 1,
110110
}
111111

112-
return m
112+
return &m
113113
}
114114

115115
func (m *Model) update() {

internal/ui/detail/detail.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ import (
1616
type Model struct {
1717
theme *theme.Theme
1818
digest *digest.Digest
19-
statbar statbar.Model
19+
statbar *statbar.Model
2020
charts []tea.Model
2121
viewport viewport.Model
2222
ready bool
@@ -25,12 +25,12 @@ type Model struct {
2525
}
2626

2727
// Init implements tea.Model.
28-
func (m Model) Init() tea.Cmd {
28+
func (m *Model) Init() tea.Cmd {
2929
return nil
3030
}
3131

3232
// Update implements tea.Model.
33-
func (m Model) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
33+
func (m *Model) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
3434
var (
3535
cmds []tea.Cmd
3636
cmd tea.Cmd
@@ -78,7 +78,7 @@ func (m Model) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
7878
}
7979

8080
// View implements tea.Model.
81-
func (m Model) View() string {
81+
func (m *Model) View() string {
8282
if !m.ready {
8383
return "\n Initializing..."
8484
}
@@ -87,7 +87,7 @@ func (m Model) View() string {
8787
}
8888

8989
// New creates new detail instance.
90-
func New(theme *theme.Theme, digest *digest.Digester, panels []*statbar.Panel) Model {
90+
func New(theme *theme.Theme, digest *digest.Digester, panels []*statbar.Panel) *Model {
9191
m := Model{theme: theme}
9292

9393
m.statbar = statbar.New(theme, panels)
@@ -111,7 +111,7 @@ func New(theme *theme.Theme, digest *digest.Digester, panels []*statbar.Panel) M
111111
m.charts = append(m.charts, chart)
112112
}
113113

114-
return m
114+
return &m
115115
}
116116

117117
func (m *Model) update() {

internal/ui/divider/divider.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,12 @@ type Model struct {
1818
}
1919

2020
// Init implements tea.Model.
21-
func (m Model) Init() tea.Cmd {
21+
func (m *Model) Init() tea.Cmd {
2222
return nil
2323
}
2424

2525
// Update implements tea.Model.
26-
func (m Model) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
26+
func (m *Model) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
2727
switch msg := msg.(type) {
2828
case *digest.Digest:
2929
m.digest = msg
@@ -38,7 +38,7 @@ func (m Model) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
3838
}
3939

4040
// View implements tea.Model.
41-
func (m Model) View() string {
41+
func (m *Model) View() string {
4242
if !m.ready {
4343
return ""
4444
}
@@ -67,6 +67,6 @@ func (m *Model) progress() string {
6767
}
6868

6969
// New creates new divider instance.
70-
func New(theme *theme.Theme) Model {
71-
return Model{theme: theme}
70+
func New(theme *theme.Theme) *Model {
71+
return &Model{theme: theme}
7272
}

internal/ui/help/help.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,12 @@ type Model struct {
2929
}
3030

3131
// Init implements tea.Model.
32-
func (m Model) Init() tea.Cmd {
32+
func (m *Model) Init() tea.Cmd {
3333
return nil
3434
}
3535

3636
// Update implements tea.Model.
37-
func (m Model) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
37+
func (m *Model) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
3838
var cmd tea.Cmd
3939

4040
switch msg := msg.(type) {
@@ -62,7 +62,7 @@ func (m Model) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
6262
}
6363

6464
// View implements tea.Model.
65-
func (m Model) View() string {
65+
func (m *Model) View() string {
6666
if !m.ready {
6767
return ""
6868
}
@@ -71,10 +71,10 @@ func (m Model) View() string {
7171
}
7272

7373
// New creates new help instance.
74-
func New(theme *theme.Theme) Model {
74+
func New(theme *theme.Theme) *Model {
7575
m := Model{theme: theme}
7676

77-
return m
77+
return &m
7878
}
7979

8080
func (m *Model) update() {

internal/ui/overview/overview.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,25 +30,25 @@ type Model struct {
3030
}
3131

3232
// Init implements tea.Model.
33-
func (m Model) Init() tea.Cmd {
33+
func (m *Model) Init() tea.Cmd {
3434
return nil
3535
}
3636

3737
// View implements tea.Model.
38-
func (m Model) View() string {
38+
func (m *Model) View() string {
3939
return m.viewport.View()
4040
}
4141

4242
// New creates new overview instance.
43-
func New(theme *theme.Theme) Model {
44-
return Model{
43+
func New(theme *theme.Theme) *Model {
44+
return &Model{
4545
theme: theme,
4646
throughput: throughput.New(),
4747
}
4848
}
4949

5050
// Update implements tea.Model.
51-
func (m Model) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
51+
func (m *Model) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
5252
var (
5353
cmds []tea.Cmd
5454
cmd tea.Cmd

0 commit comments

Comments
 (0)