hoff icon indicating copy to clipboard operation
hoff copied to clipboard

Ensure that Filter methods return empty slice when nothing matches

Open chrispappas opened this issue 3 years ago • 0 comments

  • previously if the filter matched nothing, []T(nil) would be returned, rather than an actual empty slice []T{}
  • this is because we weren't initializing the out return value, so if nothing matched the filter, it would just return the default value of nil
  • add Example and "No Matches" tests

chrispappas avatar Aug 31 '22 16:08 chrispappas