🛠 golangci-lint
This commit is contained in:
parent
8d74dc24e5
commit
7aae44048a
9 changed files with 144 additions and 85 deletions
|
|
@ -20,17 +20,17 @@ type errMsg error
|
|||
|
||||
type textMessage string
|
||||
|
||||
func newModel(text string) model {
|
||||
func newModel(text string) *model {
|
||||
s := spinner.New()
|
||||
s.Spinner = spinner.Dot
|
||||
return model{spinner: s, text: text}
|
||||
return &model{spinner: s, text: text}
|
||||
}
|
||||
|
||||
func (m model) Init() tea.Cmd {
|
||||
func (m *model) Init() tea.Cmd {
|
||||
return m.spinner.Tick
|
||||
}
|
||||
|
||||
func (m model) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
|
||||
func (m *model) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
|
||||
switch msg := msg.(type) {
|
||||
case errMsg:
|
||||
m.err = msg
|
||||
|
|
@ -47,7 +47,7 @@ func (m model) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
|
|||
}
|
||||
}
|
||||
|
||||
func (m model) View() string {
|
||||
func (m *model) View() string {
|
||||
if m.err != nil {
|
||||
return m.err.Error()
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue