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
id.go
View File

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