Instanciate common attributes everywhere so one can simply use the extend method

This commit is contained in:
2024-10-19 14:52:19 +02:00
parent a7a6b5c711
commit 7f30fd5411
18 changed files with 72 additions and 23 deletions

5
id.go
View File

@@ -14,7 +14,10 @@ type ID struct {
// NewID creates a new ID. It returns a *ID.
func NewID(uri string) *ID {
return &ID{URI: uri}
return &ID{
CommonAttributes: newCommonAttributes(),
URI: uri,
}
}
// Check checks the ID for incompatibilities with RFC4287. It returns an error.