Skip to content

net/http: dubious code in TestServeMuxHandlerRedirects #18068

Closed
@dominikh

Description

@dominikh

The test TestServeMuxHandlerRedirects in net/http/serve_test.go looks dubious. The for tries > 0 loop will execute exactly once – tries starts at 1, gets decremented once at the bottom of the loop, and there is no path that would skip the decrement and execute the loop again. Similarly, the check if tries < 0 can never be true – tries will either be its initial value of 1, or the once-decremented value 0.

/cc @bradfitz

Metadata

Metadata

Assignees

No one assigned

    Labels

    FrozenDueToAgeNeedsInvestigationSomeone must examine and confirm this is a valid issue and not a duplicate of an existing one.TestingAn issue that has been verified to require only test changes, not just a test failure.

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions