Change URI to IRI after finding validation pattern

This commit is contained in:
2024-10-16 17:33:25 +02:00
parent b76e529ca3
commit 082e71a698
10 changed files with 41 additions and 32 deletions

View File

@@ -8,7 +8,7 @@ import (
type Generator struct {
*CommonAttributes
URI URI `xml:"uri,attr,omitempty"`
URI IRI `xml:"uri,attr,omitempty"`
Version string `xml:"version,attr,omitempty"`
Text string `xml:"text"`
}
@@ -19,7 +19,7 @@ func NewGenerator(text string) *Generator {
func (g *Generator) Check() error {
if g.URI != "" {
if !isValidURI(g.URI) {
if !isValidIRI(g.URI) {
return fmt.Errorf("uri attribute %v of generator not correctly formatted", g.URI)
}
}