mirror of
https://github.com/taigrr/bubbletea.git
synced 2026-04-02 02:59:09 -07:00
docs: fix lint issues in examples and tutorials (#759)
Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
This commit is contained in:
committed by
GitHub
parent
b2d2ac6504
commit
b80eb8303b
@@ -24,7 +24,7 @@ type responseMsg struct{}
|
||||
func listenForActivity(sub chan struct{}) tea.Cmd {
|
||||
return func() tea.Msg {
|
||||
for {
|
||||
time.Sleep(time.Millisecond * time.Duration(rand.Int63n(900)+100))
|
||||
time.Sleep(time.Millisecond * time.Duration(rand.Int63n(900)+100)) // nolint:gosec
|
||||
sub <- struct{}{}
|
||||
}
|
||||
}
|
||||
@@ -46,7 +46,7 @@ type model struct {
|
||||
|
||||
func (m model) Init() tea.Cmd {
|
||||
return tea.Batch(
|
||||
spinner.Tick,
|
||||
m.spinner.Tick,
|
||||
listenForActivity(m.sub), // generate activity
|
||||
waitForActivity(m.sub), // wait for activity
|
||||
)
|
||||
@@ -78,8 +78,6 @@ func (m model) View() string {
|
||||
}
|
||||
|
||||
func main() {
|
||||
rand.Seed(time.Now().UTC().UnixNano())
|
||||
|
||||
p := tea.NewProgram(model{
|
||||
sub: make(chan struct{}),
|
||||
spinner: spinner.New(),
|
||||
|
||||
Reference in New Issue
Block a user