package
Version:
v0.0.0-...-4b9bf86
Opens a new window with list of versions in this module.
Published: Mar 22, 2020
License: MIT
Opens a new window with license information.
Imports: 0
Opens a new window with list of imports.
Imported by: 0
Opens a new window with list of known importers.
Documentation
¶
Package stack provides a normal (=non-concurrency-safe) stack
for anything (interface{})
Note: the very crisp implementation was found in cmd/go/pkg.go importStack
Stack implements a normal (=non-concurrency-safe) stack
for anything (interface{})
based on a slice, and never shrinking
New returns a new empty stack with given initial capacity
Drop pops sth silently off the current stack
func (s *Stack) Get() []interface{}
Get returns a copy of the current stack
Init returns an empty stack with given initial capacity
Len returns the length of the current stack
func (s *Stack) Pop() interface{}
Pop sth off the current stack
func (s *Stack) Push(l interface{})
Push sth onto the current stack
func (s *Stack) Top() interface{}
Top returns the top of the current stack
Source Files
¶
Click to show internal directories.
Click to hide internal directories.