Skip to content

fix(26_errors): implement divide and processDivision with error handling - #87

Merged
zhravan merged 1 commit into
zhravan:mainfrom
sidharth-chauhan:fix/26_errors
Sep 25, 2025
Merged

fix(26_errors): implement divide and processDivision with error handling#87
zhravan merged 1 commit into
zhravan:mainfrom
sidharth-chauhan:fix/26_errors

Conversation

@sidharth-chauhan

Copy link
Copy Markdown
Contributor

Goal

Implement the solution for exercise 26_errors.

Changes

  • Implemented divide with proper error handling for division by zero.
  • Implemented processDivision to call divide and print the result or error.
  • Added a minimal custom error type (divZeroErr) to ensure compatibility with
    errors.Is in the provided tests.
  • Added inline comments for clarity.

Acceptance Criteria

  • Code implemented in internal/exercises/solutions/26_errors.
  • All tests pass (go test ./internal/exercises/templates/26_errors -v).
  • Code is simple, and covers edge cases.

References

Cross-linked issue: #35

@zhravan
zhravan merged commit 8cabfd6 into zhravan:main Sep 25, 2025
@sidharth-chauhan
sidharth-chauhan deleted the fix/26_errors branch September 29, 2025 09:59
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.

2 participants