fix: lint issues
This commit is contained in:
parent
59ca08b21c
commit
faa0b9c36b
3 changed files with 7 additions and 3 deletions
|
|
@ -34,7 +34,7 @@ type sequenceMsg []Cmd
|
|||
// none it returns nil, if there is exactly one it returns that command
|
||||
// directly, else it returns the non-nil commands as type T.
|
||||
func compactCmds[T ~[]Cmd](cmds []Cmd) Cmd {
|
||||
var validCmds []Cmd //nolint:prealloc
|
||||
var validCmds []Cmd
|
||||
for _, c := range cmds {
|
||||
if c == nil {
|
||||
continue
|
||||
|
|
|
|||
|
|
@ -748,7 +748,11 @@ func (s *cursedRenderer) insertAbove(str string) error {
|
|||
}
|
||||
|
||||
_, err := io.WriteString(s.w, sb.String())
|
||||
return err
|
||||
if err != nil {
|
||||
return fmt.Errorf("bubbletea: error writing insert above to the writer: %w", err)
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// onMouse implements renderer.
|
||||
|
|
|
|||
2
tea.go
2
tea.go
|
|
@ -839,7 +839,7 @@ func (p *Program) eventLoop(model Model, cmds chan Cmd) (Model, error) {
|
|||
p.execute(fmt.Sprint(msg.Msg))
|
||||
|
||||
case printLineMessage:
|
||||
p.renderer.insertAbove(msg.messageBody)
|
||||
p.renderer.insertAbove(msg.messageBody) //nolint:errcheck,gosec
|
||||
|
||||
case clearScreenMsg:
|
||||
p.renderer.clearScreen()
|
||||
|
|
|
|||
Loading…
Reference in a new issue