Delete deletes the current token and returns the updated slice of tokens. The cursor is not advanced to the next token. Because deletion modifies the underlying slice, this method should only be called if you have access to the original slice of tokens and/or are using the slice of tokens outside th
()
| 453 | // array will become apparent (or worse, hide from you like they |
| 454 | // did me for 3 and a half freaking hours late one night). |
| 455 | func (d *Dispenser) Delete() []Token { |
| 456 | if d.cursor >= 0 && d.cursor <= len(d.tokens)-1 { |
| 457 | d.tokens = append(d.tokens[:d.cursor], d.tokens[d.cursor+1:]...) |
| 458 | d.cursor-- |
| 459 | } |
| 460 | return d.tokens |
| 461 | } |
| 462 | |
| 463 | // DeleteN is the same as Delete, but can delete many tokens at once. |
| 464 | // If there aren't N tokens available to delete, none are deleted. |
no outgoing calls
no test coverage detected