diff --git a/src/text/template/parse/lex.go b/src/text/template/parse/lex.go index 71f228c45c..da766cc7c3 100644 --- a/src/text/template/parse/lex.go +++ b/src/text/template/parse/lex.go @@ -114,7 +114,6 @@ type lexer struct { input string // the string being scanned leftDelim string // start of action rightDelim string // end of action - state stateFn // the next lexing function to enter pos Pos // current position in the input start Pos // start position of this item width Pos // width of last rune read from input @@ -229,8 +228,8 @@ func lex(name, input, left, right string) *lexer { // run runs the state machine for the lexer. func (l *lexer) run() { - for l.state = lexText; l.state != nil; { - l.state = l.state(l) + for state := lexText; state != nil; { + state = state(l) } close(l.items) }