Skip to content

Adds utils.ValueAtIndex, utils.IndexInSlice and val.Default

Compare
Choose a tag to compare
@aidenwallis aidenwallis released this 30 Aug 12:19
· 12 commits to main since this release
ae8fff4

utils

  • utils.ValueAtIndex to fetch the value (or default) value at the index of a given slice. This is panic safe, and will return a bool as the second return value to indicate whether the value existed in the slice.
  • utils.IndexInSlice returns a boolean that indicates whether a value exists at a given index in a slice.

val

  • val.Default will return the default zero value for any given type parameter. This is just syntactical sugar on top of doing var v T