(el interface{})
| 40 | } |
| 41 | |
| 42 | func (s *Stack) Push(el interface{}) { |
| 43 | s.lock.Lock() |
| 44 | defer s.lock.Unlock() |
| 45 | |
| 46 | prepend := make([]interface{}, 1) |
| 47 | prepend[0] = el |
| 48 | s.stack = append(prepend, s.stack...) |
| 49 | s.len++ |
| 50 | } |
| 51 | |
| 52 | func (s *Stack) Peek() interface{} { |
| 53 | s.lock.Lock() |
no outgoing calls