collection

package
v0.0.4-alpha Latest Latest
Warning

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

Go to latest
Published: Sep 27, 2025 License: MIT Imports: 4 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FilterSlice

func FilterSlice[T any](slice []T, predicate func(it T) bool) []T

func MapSlice

func MapSlice[T any, R any](slice []T, transform func(it T) (R, error)) []R

func MapToInterface

func MapToInterface[T any](slice []T) []interface{}

func RemoveAt

func RemoveAt[T any](collection []T, index int) []T

Types

type Set

type Set struct {
	// contains filtered or unexported fields
}

func NewSet

func NewSet(init []int) *Set

func (*Set) Has

func (s *Set) Has(item int) bool

func (*Set) IsEmpty

func (s *Set) IsEmpty() bool

func (*Set) Put

func (s *Set) Put(item int)

func (*Set) String

func (s *Set) String() string

type Stack

type Stack[T any] struct {
	// contains filtered or unexported fields
}

func (*Stack[T]) Clear

func (s *Stack[T]) Clear()

func (*Stack[T]) IsEmpty

func (s *Stack[T]) IsEmpty() bool

func (*Stack[T]) Iterator

func (s *Stack[T]) Iterator() iter.Seq[T]

func (*Stack[T]) Pop

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

func (*Stack[T]) Push

func (s *Stack[T]) Push(item T)

func (*Stack[T]) Top

func (s *Stack[T]) Top() (*T, error)

Jump to

Keyboard shortcuts

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