Added more error handling and necessary functions

This commit is contained in:
2024-10-19 12:28:09 +02:00
parent d4e7bce5e2
commit f4dfd6d060
22 changed files with 317 additions and 122 deletions

View File

@@ -8,11 +8,11 @@ import (
type Logo struct {
XMLName xml.Name `xml:"logo"`
*CommonAttributes
URI IRI `xml:",chardata"`
URI string `xml:",chardata"` // IRI
}
// NewLogo creates a new Logo. It returns a *Logo.
func NewLogo(uri IRI) (*Logo, error) {
// NewLogo creates a new Logo. It returns a *Logo and an error.
func NewLogo(uri string) (*Logo, error) {
if !isValidIRI(uri) {
return nil, fmt.Errorf("uri %v not correctly formatted", uri)
}