Documentation ¶
Index ¶
- func DainChannel[T any](c <-chan T)
- func FileExists(path string) bool
- func MapApply[S any, R any](s []S, f func(S) R) []R
- func MapApplyIdx[S any, R any](s []S, f func(int, S) R) []R
- func RequireFileContent(t *testing.T, path, content string)
- func SetReset[T any](variable *T, newValue T) func()
- func SliceSubtract(a []string, b []string) []string
- type MultipleError
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DainChannel ¶
func DainChannel[T any](c <-chan T)
Removes all pending elements from a channel, returns when channel is exhausted
func FileExists ¶
func MapApplyIdx ¶
return a new slice created from applying f to each item in s f is called with the index into the array
func RequireFileContent ¶
func SetReset ¶
func SetReset[T any](variable *T, newValue T) func()
Small helper to make it easy to reset a value You can do something like this:
enableSomething := False ... defer SetReset(&enableSomething, true)() ( enableSomething will be True until the function exits)
func SliceSubtract ¶
This isn't really optimized, I suspect that perhaps using maps would be faster, but at that point, we'd probably want to just implement or employ a "Set" type
Types ¶
type MultipleError ¶
func (MultipleError) Error ¶
func (e MultipleError) Error() string
func (MultipleError) Unwrap ¶
func (e MultipleError) Unwrap() []error
Click to show internal directories.
Click to hide internal directories.