Don't know what you're trying to do, but the only time I've wanted the line 
number during decoding is when an error occurs.  Then I retrieve it using 
xml.SyntaxError, assuming that 'error' is of type *xml.SyntaxError.

On Friday, April 16, 2021 at 8:44:19 AM UTC-6 Patrick wrote:

> Hello all,
>
> I use the XML package from the standard library (encoding/xml) and I 
> wonder why the line attribute of the decoder is not exposed such as 
>
> func (d *Decoder) InputLine() int {
>     return d.line
> }
>
> The offset for example is exposed:
>
> func (d *Decoder) InputOffset() int64 {
>    return d.offset
> }
>
> Is there an obvious reason for that that I am missing? Or more in the line 
> of "not yet implemented"?
>
> Thanks 
>
>   Patrick
>
>
>
>

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/4c744b3b-bdb9-45e6-9a30-5b3fdb59a45en%40googlegroups.com.

Reply via email to