Get rid of checks when creating constructs. Check should handle this.

This commit is contained in:
2024-10-19 14:12:51 +02:00
parent 960889f9e7
commit 57db4178d0
21 changed files with 143 additions and 345 deletions

10
icon.go
View File

@@ -12,13 +12,9 @@ type Icon struct {
URI string `xml:",chardata"` // IRI
}
// NewIcon creates a new Icon. It returns a *Icon and an error.
func NewIcon(uri string) (*Icon, error) {
if !isValidIRI(uri) {
return nil, fmt.Errorf("uri %v not correctly formatted", uri)
}
return &Icon{URI: uri}, nil
// NewIcon creates a new Icon. It returns a *Icon.
func NewIcon(uri string) *Icon {
return &Icon{URI: uri}
}
// Check checks the Icon for incompatibilities with RFC4287. It returns an