Add checks to id
This commit is contained in:
parent
a65aa0a740
commit
bc9fd49d18
4
id.go
4
id.go
@ -19,6 +19,10 @@ func NewID() *ID {
|
|||||||
func (i *ID) Check() error {
|
func (i *ID) Check() error {
|
||||||
if i.URI == "" {
|
if i.URI == "" {
|
||||||
return errors.New("uri element of id empty")
|
return errors.New("uri element of id empty")
|
||||||
|
} else {
|
||||||
|
if !isValidURI(i.URI) {
|
||||||
|
return fmt.Errorf("uri element %v of id not correctly formatted", i.URI)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
|
Loading…
x
Reference in New Issue
Block a user