Hi, 

For golang.org/x/net/html, both Token() and Next() advance the token to the 
next, right? 

https://godoc.org/golang.org/x/net/html#Token
> Token returns the next Token.

What's the advantages of having them doing the same thing, while lacking 
one function to return the current token?
Is this by design? Shouldn't Token() be better returning the current on 
instead of the next? 

Of all the following sample code that I found, *all* are assuming 
that Token() is returning the current one. 
I.e., is this "*Token returns the next Token*" a new change? 

https://stackoverflow.com/questions/46311740/parsing-html-with-golang
https://gist.github.com/Xeoncross/7dd11225e6f1484683301f0095b1dfbc
https://play.golang.org/p/FVhuyRi9x9
https://play.golang.org/p/0MRSefJ_-E
https://play.golang.org/p/7ZwQB98kHE

Thanks

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to