Releases: elliotchance/pie
Releases · elliotchance/pie
v1.24.4
fix: Regexp for Equals() (#138) Allow the regular expression to be more flexible when the left side is not a simple variable. Fixes #137
v1.24.3
abs: lossy precision: don't convert int into float64 (#131) Fixes #130
v1.24.2
docs: Fix missing 'pie' in go:generate in README (#127)
v1.24.1
refactoring: Sequence and SequenceUsing (#126) Removing duplicate code and also fixing a bug where zero params would cause a panic. Fixes #125
v1.24.0
added: SequenceUsing (#122) SequenceUsing generates slice in range using creator function There are 3 variations to generate: 1. [0, n). 2. [min, max). 3. [min, max) with step. If len(params) == 1 considered that will be returned slice between 0 and n, where n is the first param, [0, n). If len(params) == 2 considered that will be returned slice between min and max, where min is the first param, max is the second, [min, max). If len(params) > 2 considered that will be returned slice between min and max with step, where min is the first param, max is the second, step is the third one, [min, max) with step, others params will be ignored. Fixes #107
v1.23.0
added: Ints and Floats64s (#121) Ints and Floats64s transforms each element to an int or float64 respectively.
v1.22.0
added: Strings (#120) This also allows fmt.Stringer to be used.
v1.21.0
added: custom equality (#113) Some functions that compare elements, such as Contains will use the following method if it is available on the element type: func (a ElementType) Equals(b ElementType) bool The `ElementType` must be the same for the receiver and argument and it must return a bool. Be careful to create the function on the pointer or non-pointer type that is used by the slice. Here is a minimal example: type Car struct { Name, Color string } type Cars []*Car // ElementType is *Car func (c *Car) Equals(c2 *Car) bool { return c.Name == c2.Name } Fixes #111
v1.20.1
fix: non-destructiveAppend (#101) Make sure that Append never alters the receiver or other slices sharing the same memory, unlike the built-in append. Fixes #97
v1.20.0
added: Sequence (#108) Sequence generates all numbers in range or returns nil if params invalid There are 3 variations to generate: 1. [0, n). 2. [min, max). 3. [min, max) with step. If len(params) == 1 considered that will be returned slice between 0 and n, where n is the first param, [0, n). If len(params) == 2 considered that will be returned slice between min and max, where min is the first param, max is the second, [min, max). If len(params) > 2 considered that will be returned slice between min and max with step, where min is the first param, max is the second, step is the third one, [min, max) with step, others params will be ignored. Fixes #70