Skip to content

Detect ignored yield return values #1693

Open

Description

@samber

This code:

yield(1)
yield(2)

Should be replaced by:

if yield(1) {
    yield(2)
}

See https://pkg.go.dev/golang.org/x/tools/gopls/internal/analysis/yield

Activity

  1. added
    needs-triage
    on Jan 7, 2026
  2. added and removed
    needs-triage
    on Feb 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions