gslices

package module
v0.0.0-...-e7a49a9 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 18, 2024 License: MIT Imports: 2 Imported by: 0

README

gslices

Overview

This is my own slices package for Go, because I don't like the stdlib API.

Please consider using the stdlib package or make your own wrapper instead of using this package.

The g prefix implies a strong connection with my other game development packages, like gsignal. It's not a coincidence, I'm using this library for game development which implies that I'm willing to prioritize its needs over anything else. But unlike other g-packages, there is a standard library alternative. Therefore, I can't recommend using it to anyone apart from myself.

Installation

go get github.com/quasilyte/gslices

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Clone

func Clone[T any](s []T) []T

func Contains

func Contains[T comparable](s []T, x T) bool

func Delete

func Delete[T comparable](s []T, x T) []T

func DeleteAt

func DeleteAt[T any](s []T, i int) []T

func Index

func Index[T comparable](s []T, x T) int

func IndexFunc

func IndexFunc[T comparable](s []T, f func(x T) bool) int

func InsertAt

func InsertAt[T any](s []T, x T, i int) []T

func Move

func Move[T any](s []T, from, to int) []T

func Sort

func Sort[T constraints.Ordered](s []T)

func SortFunc

func SortFunc[T any](slice []T, less func(a, b T) bool)

func SortStableFunc

func SortStableFunc[T any](s []T, less func(a, b T) bool)

func Swap

func Swap[T any](s []T, i, j int)

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL