Make NewLogo more flexible
This commit is contained in:
parent
30623fdfe0
commit
cb61d90cae
4
id.go
4
id.go
@ -11,8 +11,8 @@ type ID struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// NewID creates a new ID. It returns a *ID.
|
// NewID creates a new ID. It returns a *ID.
|
||||||
func NewID(id IRI) *ID {
|
func NewID(uri IRI) *ID {
|
||||||
return &ID{URI: IRI(id)}
|
return &ID{URI: IRI(uri)}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Check checks the ID for incompatibilities with RFC4287. It returns an error.
|
// Check checks the ID for incompatibilities with RFC4287. It returns an error.
|
||||||
|
6
logo.go
6
logo.go
@ -3,8 +3,6 @@ package atom
|
|||||||
import (
|
import (
|
||||||
"errors"
|
"errors"
|
||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
"github.com/google/uuid"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
type Logo struct {
|
type Logo struct {
|
||||||
@ -13,8 +11,8 @@ type Logo struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// NewLogo creates a new Logo. It returns a *Logo.
|
// NewLogo creates a new Logo. It returns a *Logo.
|
||||||
func NewLogo() *Logo {
|
func NewLogo(uri string) *Logo {
|
||||||
return &Logo{URI: IRI(fmt.Sprint("urn:uuid:", uuid.New()))}
|
return &Logo{URI: IRI(uri)}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Check checks the Logo for incompatibilities with RFC4287. It returns an
|
// Check checks the Logo for incompatibilities with RFC4287. It returns an
|
||||||
|
Loading…
x
Reference in New Issue
Block a user