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

Add error buffer util #8620

Merged
merged 3 commits into from
Mar 6, 2023
Merged

Add error buffer util #8620

merged 3 commits into from
Mar 6, 2023

Conversation

essamhassan
Copy link
Contributor

This util makes use of the go1.20 error changes and expose a ring buffer interface for errors. This can be useful for tracking latest K crits on a service. Next steps is including this as part of startstoponce iface

Example Usage

		buff := utils.ErrorBuffer{Cap: 2}
		buff.Append(err1)
		buff.Append(err2)
		combined := buff.Flush() // []error
		errs := utils.UnwrapError(combined) // if combined is a joinedErr, return combined.Unwrap() otherwise return []error{combined}

Go errors @1.20

@github-actions
Copy link
Contributor

github-actions bot commented Mar 3, 2023

I see that you haven't updated any CHANGELOG files. Would it make sense to do so?

@krehermann krehermann self-requested a review March 3, 2023 16:35
krehermann
krehermann previously approved these changes Mar 3, 2023
jmank88
jmank88 previously approved these changes Mar 3, 2023
core/utils/utils.go Outdated Show resolved Hide resolved
@essamhassan essamhassan dismissed stale reviews from jmank88 and krehermann via 68ac150 March 6, 2023 11:47
@essamhassan essamhassan force-pushed the util/add-error-buffer branch from 90a6fbb to 68ac150 Compare March 6, 2023 11:47
core/utils/utils.go Outdated Show resolved Hide resolved
@essamhassan essamhassan force-pushed the util/add-error-buffer branch from bfe33f7 to 7f4e142 Compare March 6, 2023 17:24
@essamhassan essamhassan force-pushed the util/add-error-buffer branch from 7f4e142 to cca49fc Compare March 6, 2023 17:31
@cl-sonarqube-production
Copy link

SonarQube Quality Gate

Quality Gate failed

Failed condition 80.0% 80.0% Coverage on New Code (is less than 90%)

See analysis details on SonarQube

@essamhassan essamhassan merged commit f07b8cc into develop Mar 6, 2023
@essamhassan essamhassan deleted the util/add-error-buffer branch March 6, 2023 18:20
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.

3 participants