Files
2020-10-12 08:16:08 -03:00

18 lines
294 B
Go

package entity
import "github.com/google/uuid"
//ID entity ID
type ID = uuid.UUID
//NewID create a new entity ID
func NewID() ID {
return ID(uuid.New())
}
//StringToID convert a string to an entity ID
func StringToID(s string) (ID, error) {
id, err := uuid.Parse(s)
return ID(id), err
}