aboutsummaryrefslogtreecommitdiff
path: root/objects/id.go
diff options
context:
space:
mode:
Diffstat (limited to 'objects/id.go')
-rw-r--r--objects/id.go8
1 files changed, 8 insertions, 0 deletions
diff --git a/objects/id.go b/objects/id.go
index e651801..224b3cd 100644
--- a/objects/id.go
+++ b/objects/id.go
@@ -68,6 +68,14 @@ func ParseObjectId(s string) (oid ObjectId, err error) {
return
}
+func MustParseObjectId(s string) ObjectId {
+ id, err := ParseObjectId(s)
+ if err != nil {
+ panic(err)
+ }
+ return id
+}
+
func (a ObjectId) Equals(b ObjectId) bool {
return a.Algo == b.Algo && bytes.Equal(a.Sum, b.Sum)
}