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

     1  // Package reverse provides shor aliases for cloning slices with the elements in reverse order
     2  package reverse
     3  
     4  import (
     5  	"github.com/m4gshm/gollections/slice"
     6  	"github.com/m4gshm/gollections/slice/clone"
     7  )
     8  
     9  // Of clones a slice of elements and reverses the order
    10  func Of[TS ~[]T, T any](elements TS) TS {
    11  	return slice.Reverse(clone.Of(elements))
    12  }