Added and corrected comments
This commit is contained in:
2
id.go
2
id.go
@@ -12,10 +12,12 @@ type ID struct {
|
||||
URI IRI `xml:"uri"`
|
||||
}
|
||||
|
||||
// NewID creates a new ID. It returns a *ID.
|
||||
func NewID() *ID {
|
||||
return &ID{URI: IRI(fmt.Sprint("urn:uuid:", uuid.New()))}
|
||||
}
|
||||
|
||||
// Check checks the ID for incompatibilities with RFC4287. It returns an error.
|
||||
func (i *ID) Check() error {
|
||||
if i.URI == "" {
|
||||
return errors.New("uri element of id empty")
|
||||
|
Reference in New Issue
Block a user