Skip to content

How to handle false positives for leaky-time-after ? #60

@zerkms

Description

@zerkms

Given this valid code:

func (ja *jsonAuth) timer() {
	for {
		select {
		case <-ja.ctx.Done():
			return
		case <-time.After(time.Minute):
			ja.tick()
		}
	}
}

where time.After is run every loop iteration but on application shutdown, how would one fix the rule violation?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions