Skip to content

Conversation

momeni
Copy link

@momeni momeni commented Feb 8, 2024

The package documentation asks to call Step method as while as it returns true, so it has to return false only on the first error or if all expected steps were taken previously.
This condition was implemented correctly in the first if-condition where it returned false when there were no more steps or an error was detected.
However, the ultimate return statement and the method godoc used to return false as while as the Step should be called again. This commit resolves this inconsistency and updates the relevant godocs.

-       return c.step > 2 || c.err != nil
+       return c.step <= 2 && c.err == nil

The RFC 5802 example test case is added too.

The package documentation asks to call Step method as while as it
returns true, so it has to return false only on the first error or
if all expected steps were taken previously.
This condition was implemented correctly in the first if-condition
where it returned false when there were no more steps or an error was
detected.
However, the ultimate return statement and the method godoc used to
return false as while as the Step should be called again.
This commit resolves this inconsistency and updates the relevant godocs.

The RFC 5802 example test case is added too.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant