Discover Packages
github.com/domluna/container
stack
package
Version:
v0.0.0-...-f52cd5e
Opens a new window with list of versions in this module.
Published: Oct 31, 2014
License: MIT
Opens a new window with license information.
Imports: 1
Opens a new window with list of imports.
Imported by: 0
Opens a new window with list of known importers.
README
README
¶
stack
View the docs
Installation
$ go get github.com/domluna/container/stack
Example
import "github.com/domluna/container/stack"
func main() {
s := stack.New()
s.Push(22)
s.Push(55)
v := t.Pop() // v = 55
v := t.Pop() // v = 22
v := t.Get() // v = nil
}
Expand ▾
Collapse ▴
Documentation
¶
Stack is a stack data structure.
func (s *Stack ) Pop() interface{}
Pop removes an element from the top of the stack.
func (s *Stack ) Push(v interface{})
Push inserts an element at the top of the stack.
Source Files
¶
Click to show internal directories.
Click to hide internal directories.