Add checks to id

This commit is contained in:
Jason Streifling 2024-10-16 17:07:57 +02:00
parent a65aa0a740
commit bc9fd49d18

4
id.go
View File

@ -19,6 +19,10 @@ func NewID() *ID {
func (i *ID) Check() error {
if i.URI == "" {
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