Top returns the state at the top of the stack
()
| 9 | |
| 10 | // Top returns the state at the top of the stack |
| 11 | func (ss *Stack) Top() string { |
| 12 | sz := len(*ss) |
| 13 | if sz == 0 { |
| 14 | return "" |
| 15 | } |
| 16 | return (*ss)[sz-1] |
| 17 | } |
| 18 | |
| 19 | // Push appends state to stack |
| 20 | func (ss *Stack) Push(state string) { |
no outgoing calls
no test coverage detected