github.com/m4gshm/gollections@v0.0.13-0.20240331203319-a34a86e58a24/slice/range_/api.go (about)

     1  // Package range_ provides alias for the slice.Range function
     2  package range_
     3  
     4  import (
     5  	"golang.org/x/exp/constraints"
     6  
     7  	"github.com/m4gshm/gollections/slice"
     8  )
     9  
    10  // Of - range_.Of short alias of the slice.Range
    11  func Of[T constraints.Integer | rune](from T, to T) []T {
    12  	return slice.Range(from, to)
    13  }
    14  
    15  // Closed - range_.Closed short alias of the slice.RangeClosed
    16  func Closed[T constraints.Integer | rune](from T, to T) []T {
    17  	return slice.RangeClosed(from, to)
    18  }