Skip to content
/ errorsample Public

Package errorsample samples error values uniformly at random from an unbounded set of inputs.

Notifications You must be signed in to change notification settings

kr/errorsample

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Package errorsample samples error values uniformly at
random from an unbounded set of inputs.

If you have more errors than you know what to do with,
and you can't read them all or even store them all,
and you want to get a rough idea of what all is going
wrong, this package is for you!

	set := errorsample.New(20)
	...
	set.Add(err) // add errors
	...
	set.Add(err) // LOTS of errors
	...
	errs := make([]error, set.Cap())
	errs = errs[:set.Sample(errs)]
	fmt.Println("20 representative errors:", errs)

About

Package errorsample samples error values uniformly at random from an unbounded set of inputs.

Resources

Stars

Watchers

Forks

Releases

No releases published

Languages