Get rid of checks when creating constructs. Check should handle this.
This commit is contained in:
10
id.go
10
id.go
@@ -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.
|
||||
|
Reference in New Issue
Block a user