Added and corrected comments

This commit is contained in:
2024-10-16 19:59:28 +02:00
parent 6a76bdc0c3
commit 4220a2acc6
23 changed files with 131 additions and 39 deletions

View File

@@ -10,10 +10,13 @@ type Icon struct {
URI IRI `xml:"uri"`
}
// NewIcon creates a new Icon. It returns a *Icon.
func NewIcon(uri string) *Icon {
return &Icon{URI: IRI(uri)}
}
// Check checks the Icon for incompatibilities with RFC4287. It returns an
// error.
func (i *Icon) Check() error {
if i.URI == "" {
return errors.New("uri element of icon empty")