Standard library / encoding/xml
encoding/xml.TagPathError.Error()
Describes conflicting struct tag paths; fix the conflicting field mapping. Expected stdout: 'true true\n'.
Formal Syntax & Structure
go syntaxgo
func (e *TagPathError) Error() stringReturn Value
string
Text representation.
Working Example
Example Snippetgo
package main
import ( "encoding/xml" "errors" "fmt")
func must(e error) { if e != nil { panic(e) }}
func main() { _, e := xml.Marshal(struct { A string `xml:"x"` B string `xml:"x>y"` }{A: "a", B: "b"}) var te *xml.TagPathError fmt.Println(errors.As(e, &te), te.Error() != "")}