MCPcopy Create free account
hub / github.com/armstrongli/learn.go / Push

Method Push

chapter07/02.stack/main.go:11–13  ·  view source on GitHub ↗
(data interface{})

Source from the content-addressed store, hash-verified

9}
10
11func (s *Stack) Push(data interface{}) {
12 s.data = append([]interface{}{data}, s.data...)
13}
14
15func (s *Stack) Pop() (interface{}, bool) {
16 if len(s.data) > 0 {

Callers 1

mainFunction · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected