Documentation
¶
Overview ¶
Package util contains helper functions and data structures.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AppendToTop ¶ added in v0.2.0
AppendToTop Appends a new value to the top slice of the stack.
func AppendToTopChecked ¶ added in v0.2.0
Types ¶
type Stack ¶ added in v0.2.0
type Stack[T any] struct { // contains filtered or unexported fields }
Stack implementation with generics
func (*Stack[T]) Clear ¶ added in v0.2.0
func (s *Stack[T]) Clear()
Clear drops all values from the stack
func (*Stack[T]) Peek ¶ added in v0.2.0
Peek returns the top most value from the stack without removing it Throws and error if the stack is empty
func (*Stack[T]) Pop ¶ added in v0.2.0
Pop takes the top most value from the stack Throws and error if the stack is empty
func (*Stack[T]) Push ¶ added in v0.2.0
func (s *Stack[T]) Push(v T)
Push adds a value v to the top of the stack
Click to show internal directories.
Click to hide internal directories.