Added more error handling and necessary functions
This commit is contained in:
4
icon.go
4
icon.go
@@ -9,11 +9,11 @@ import (
|
||||
type Icon struct {
|
||||
XMLName xml.Name `xml:"icon"`
|
||||
*CommonAttributes
|
||||
URI IRI `xml:",chardata"`
|
||||
URI string `xml:",chardata"` // IRI
|
||||
}
|
||||
|
||||
// NewIcon creates a new Icon. It returns a *Icon and an error.
|
||||
func NewIcon(uri IRI) (*Icon, error) {
|
||||
func NewIcon(uri string) (*Icon, error) {
|
||||
if !isValidIRI(uri) {
|
||||
return nil, fmt.Errorf("uri %v not correctly formatted", uri)
|
||||
}
|
||||
|
Reference in New Issue
Block a user