Val gets the text of the current token. If there is no token loaded, it returns empty string.
()
| 200 | // Val gets the text of the current token. If there is no token |
| 201 | // loaded, it returns empty string. |
| 202 | func (d *Dispenser) Val() string { |
| 203 | if d.cursor < 0 || d.cursor >= len(d.tokens) { |
| 204 | return "" |
| 205 | } |
| 206 | return d.tokens[d.cursor].Text |
| 207 | } |
| 208 | |
| 209 | // ValRaw gets the raw text of the current token (including quotes). |
| 210 | // If the token was a heredoc, then the delimiter is not included, |
no outgoing calls