Remove the top element from the stack and return it's value If the stack is empty, return nil
()
| 33 | // Remove the top element from the stack and return it's value |
| 34 | // If the stack is empty, return nil |
| 35 | func (s *B2GrowableStack) Pop() (value interface{}) { |
| 36 | if s.size > 0 { |
| 37 | value, s.top = s.top.value, s.top.next |
| 38 | s.size-- |
| 39 | return |
| 40 | } |
| 41 | return nil |
| 42 | } |