Skip to content

Conversation

@qustavo
Copy link
Owner

@qustavo qustavo commented Nov 25, 2019

No description provided.

ccmtaylor and others added 4 commits November 25, 2019 10:42
adds func Compose that allows composing multiple Hooks into one.
It runs every callback on every hook in argument order,
even if previous hooks return an error.
If multiple hooks return errors, the error return value will be
MultipleErrors, which allows for introspecting the errors if necessary.

I chose not to abort processing when any handler returns an error,
because common usage would be to compose logging / tracing / metrics,
and those kinds of handlers will want to run in every case to make
sure that e.g. latencies are tracked correctly.

I added compatibility with Go 1.13's errors.Is/errors.As methods under
a conditional compilation flag.

Fixes: #12
@coveralls
Copy link

Coverage Status

Coverage increased (+2.2%) to 75.094% when pulling 50840d6 on ccmtaylor-compose into e598f34 on master.

1 similar comment
@coveralls
Copy link

Coverage Status

Coverage increased (+2.2%) to 75.094% when pulling 50840d6 on ccmtaylor-compose into e598f34 on master.

@qustavo qustavo mentioned this pull request Nov 25, 2019
@qustavo qustavo merged commit 70eb897 into master Nov 25, 2019
@qustavo qustavo deleted the ccmtaylor-compose branch November 25, 2019 14:22
qustavo pushed a commit that referenced this pull request Nov 25, 2019
@qustavo qustavo restored the ccmtaylor-compose branch November 25, 2019 14:25
@qustavo qustavo deleted the ccmtaylor-compose branch November 25, 2019 14:26
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.

4 participants