Create isValidURN and isValidURI and use isValidURI everywhere where it is needed
This commit is contained in:
@@ -27,6 +27,12 @@ func (c *Category) Check() error {
|
||||
return errors.New("term attribute of category empty")
|
||||
}
|
||||
|
||||
if c.Scheme != "" {
|
||||
if !isValidURI(c.Scheme) {
|
||||
return fmt.Errorf("scheme attribute of category %v not correctly formatted", c.Scheme)
|
||||
}
|
||||
}
|
||||
|
||||
if c.Content == nil {
|
||||
return errors.New("no content element of category")
|
||||
} else {
|
||||
|
Reference in New Issue
Block a user