From 1627bbdb616bd166dbce7d8ee90bb075a5f6e323 Mon Sep 17 00:00:00 2001 From: Nam Huynh Date: Mon, 9 Aug 2021 11:56:18 +0700 Subject: [PATCH] update object id funcs --- object_id.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/object_id.go b/object_id.go index 3026c85..d7dc5a4 100644 --- a/object_id.go +++ b/object_id.go @@ -12,14 +12,14 @@ func NewStringID() string { return NewObjectID().Hex() } -// ConvertFromString ... -func ConvertFromString(s string) (value primitive.ObjectID, isValid bool) { +// NewIDFromString ... +func NewIDFromString(s string) (value primitive.ObjectID, isValid bool) { id, err := primitive.ObjectIDFromHex(s) return id, err == nil } -// IsValid ... -func IsValid(s string) bool { +// IsValidID ... +func IsValidID(s string) bool { return primitive.IsValidObjectID(s) }