You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This code panics on the marked line. It seems like IsValid() incorrectly returns true when it should return false since there are no more tokens available.
p := tokenizer.New()
stream := p.ParseString("")
defer stream.Close()
for stream.IsValid() {
token := stream.CurrentToken()
if token.Is(tokenizer.TokenInteger) { // <--- panic
fmt.Println(token.ValueInt())
}
stream.GoNext()
}
I'm using 1.3.0 and the panic stack trace tells me the problem is here:
This code panics on the marked line. It seems like
IsValid()
incorrectly returns true when it should return false since there are no more tokens available.I'm using 1.3.0 and the panic stack trace tells me the problem is here:
The text was updated successfully, but these errors were encountered: