Documentation ¶
Index ¶
- func IsEmpty[T any](stack []T) bool
- func IsFull[T any](stack []T) bool
- func Peek[T any](stack []T) (T, error)
- func PeekN[T any](stack []T, n uint) ([]T, error)
- func Pop[T any](stack []T) ([]T, T, error)
- func PopN[T any](stack []T, n uint) ([]T, []T, error)
- func Push[T any](stack []T, val T) ([]T, error)
- func PushMany[T any](stack []T, vals []T) ([]T, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Peek ¶
Peek copies the top element of the stack.
Returns the element on the top of the stack or ErrEmpty if stack is empty. FIXME needs testing
func PeekN ¶
PeekN peeks for the top `n` elements on the stack.
Returns slice of top `n` elements, or ErrEmpty if more elements are requested than are present. FIXME needs testing
func Pop ¶
Pop pops an element off the stack.
Returns updated stack and element, or ErrEmpty if stack is empty. FIXME needs testing
func PopN ¶
PopN pops `n` elements off the stack.
Returns updated stack and elements, or ErrEmpty if more elements are popped than are present. FIXME needs testing
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.