Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make dump() not be anyerror!... #31

Closed
Arnau478 opened this issue May 15, 2024 · 1 comment
Closed

Make dump() not be anyerror!... #31

Arnau478 opened this issue May 15, 2024 · 1 comment
Assignees
Milestone

Comments

@Arnau478
Copy link
Owner

It's very tedious to work with a library where the main function does not have a defined error set. The problem is that it uses an AnyWriter, which returns anyerror!... for most functions. Here are some options to fix this:

  • Stop using AnyWriter
  • Collapse every error that comes from a writer call to a single error.WriteError
@Arnau478 Arnau478 added this to the 1.0.0 milestone May 15, 2024
@Arnau478 Arnau478 added the help wanted Extra attention is needed label Jun 19, 2024
@Arnau478 Arnau478 removed the help wanted Extra attention is needed label Jul 2, 2024
@Arnau478
Copy link
Owner Author

Arnau478 commented Jul 2, 2024

I think the best approach is to not use AnyWriter at all, and pass an anytype. This has the advantage of having a defined arror set, that can be computed at comptime. Thus, errors are not collapsed either.

@Arnau478 Arnau478 self-assigned this Jul 2, 2024
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

No branches or pull requests

1 participant