From bc9fd49d1820f16247af919adb4368be5184f86d Mon Sep 17 00:00:00 2001 From: Jason Streifling Date: Wed, 16 Oct 2024 17:07:57 +0200 Subject: [PATCH] Add checks to id --- id.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/id.go b/id.go index 180070f..9f69714 100644 --- a/id.go +++ b/id.go @@ -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