gslices

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

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

Go to latest
Published: Dec 27, 2024 License: MIT Imports: 2 Imported by: 3

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)

func DeleteAt

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

func DeleteFunc

func DeleteFunc[T any](s *[]T, f func(x T) bool)

func FilterInplace

func FilterInplace[T any](s []T, f func(x T) bool) []T

func Find

func Find[T comparable](s []T, x T) (result T)

func FindFunc

func FindFunc[T comparable](s []T, f func(x T) bool) (result T)

func Index

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

func IndexFunc

func IndexFunc[T any](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 Pop

func Pop[T any](s *[]T) T

func Push

func Push[T any](s *[]T, x 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)

func Transfer

func Transfer[T comparable](from, to *[]T, x T)

Types

This section is empty.

Jump to

Keyboard shortcuts

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