We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 16459a8 commit c212f69Copy full SHA for c212f69
model.go
@@ -212,6 +212,14 @@ func NewULID() ULID {
212
return id
213
}
214
215
+// NewULIDFromText creates a new ULID from its string representation. Will
216
+// return an error if the text is not a valid ULID.
217
+func NewULIDFromText(text string) (ULID, error) {
218
+ var id ULID
219
+ err := id.UnmarshalText([]byte(text))
220
+ return id, err
221
+}
222
+
223
// Scan implements the Scanner interface.
224
func (id *ULID) Scan(src interface{}) error {
225
switch src := src.(type) {
0 commit comments