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:
Carlos Alexandro Becker
2023-06-09 13:33:53 -03:00
committed by GitHub
parent b2d2ac6504
commit b80eb8303b
18 changed files with 47 additions and 66 deletions

View File

@@ -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(),