Documentation ¶
Index ¶
- type Stack
- func (s *Stack) BufferSize() int
- func (s *Stack) Extend(extendBy int)
- func (s *Stack) Get(i int) (interface{}, error)
- func (s *Stack) Grow(min int)
- func (s *Stack) Pop() interface{}
- func (s *Stack) Push(v interface{})
- func (s *Stack) Reset()
- func (s *Stack) Resize(size int)
- func (s *Stack) Set(i int, v interface{}) error
- func (s *Stack) Size() int
- func (s *Stack) String() string
- func (s *Stack) Top() (interface{}, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Stack ¶
type Stack []interface{}
Stack is a simple structure to hold various data
func (*Stack) BufferSize ¶
BufferSize returns the length of the underlying buffer
func (*Stack) Grow ¶
Grow automatically grows the underlying buffer so that it can hold at least `min` elements
func (*Stack) Pop ¶
func (s *Stack) Pop() interface{}
Pop removes and returns the item at the end of the stack
func (*Stack) Push ¶
func (s *Stack) Push(v interface{})
Push adds an element at the end of the stack
func (*Stack) Reset ¶
func (s *Stack) Reset()
Reset clears the contents of the stack and pushes back the cursor as if nothing is in the stack
func (*Stack) Set ¶
Set sets the element at position `i` to `v`. The stack size is automatically adjusted.
Click to show internal directories.
Click to hide internal directories.