Skip to content

v0.7.5

Choose a tag to compare

@mpyw mpyw released this 26 Dec 03:41
· 59 commits to main since this release
7fface6

Bug Fixes

  • Conditional reassignment detection: Fixed false negatives when variables holding closures are conditionally reassigned

    • Previously, only the last assignment was checked
    • Now checks ALL assignments from the last unconditional assignment onwards
    • Affects: goroutine, errgroup, spawner checkers
  • Factory pattern conditional reassignment: Fixed detection in factory functions that return conditionally reassigned variables

    • Previously short-circuited when finding any nested func literal using context
    • Now correctly checks only what's actually returned
    • Added recursive context-checking for nested factories (triple higher-order patterns)

Example

func example(ctx context.Context) {
    fn := func() { _ = ctx }  // uses ctx
    if condition {
        fn = func() { /* no ctx */ }  // doesn't use ctx
    }
    go fn()  // Now correctly warns: not all paths use ctx
}

Full Changelog: v0.7.4...v0.7.5