aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorkotaro.yamazaki <sentoryoku53m@gmail.com>2024-02-23 01:41:49 +0900
committerGitHub <noreply@github.com>2024-02-22 10:41:49 -0600
commit6e10cd1027e225e3ad7bfcc13c896abd165b02ef (patch)
tree8f06093ba07dd7e4c3613e6cfcc321162779c705
parentb5b9aeb1d146751d5a09f1b2ca83fd9731d3a8fa (diff)
downloadgoogle-uuid-upstream-master.tar.gz
fix: use MustParse("xxx") instead of Must(Parse("xxxx")) (#106)upstream-master
* fix to use MustParse * use MustParse(...) inseted of Must(Parse(...)) --------- Co-authored-by: Noah Dietz <noahdietz@users.noreply.github.com> Co-authored-by: bormanp <122468813+bormanp@users.noreply.github.com>
-rw-r--r--hash.go8
-rw-r--r--json_test.go2
-rw-r--r--sql_test.go4
3 files changed, 7 insertions, 7 deletions
diff --git a/hash.go b/hash.go
index dc60082..35338cd 100644
--- a/hash.go
+++ b/hash.go
@@ -12,10 +12,10 @@ import (
// Well known namespace IDs and UUIDs
var (
- NameSpaceDNS = Must(Parse("6ba7b810-9dad-11d1-80b4-00c04fd430c8"))
- NameSpaceURL = Must(Parse("6ba7b811-9dad-11d1-80b4-00c04fd430c8"))
- NameSpaceOID = Must(Parse("6ba7b812-9dad-11d1-80b4-00c04fd430c8"))
- NameSpaceX500 = Must(Parse("6ba7b814-9dad-11d1-80b4-00c04fd430c8"))
+ NameSpaceDNS = MustParse("6ba7b810-9dad-11d1-80b4-00c04fd430c8")
+ NameSpaceURL = MustParse("6ba7b811-9dad-11d1-80b4-00c04fd430c8")
+ NameSpaceOID = MustParse("6ba7b812-9dad-11d1-80b4-00c04fd430c8")
+ NameSpaceX500 = MustParse("6ba7b814-9dad-11d1-80b4-00c04fd430c8")
Nil UUID // empty UUID, all zeros
// The Max UUID is special form of UUID that is specified to have all 128 bits set to 1.
diff --git a/json_test.go b/json_test.go
index 34241d5..db2d1cc 100644
--- a/json_test.go
+++ b/json_test.go
@@ -10,7 +10,7 @@ import (
"testing"
)
-var testUUID = Must(Parse("f47ac10b-58cc-0372-8567-0e02b2c3d479"))
+var testUUID = MustParse("f47ac10b-58cc-0372-8567-0e02b2c3d479")
func TestJSON(t *testing.T) {
type S struct {
diff --git a/sql_test.go b/sql_test.go
index 1803dfd..929b10f 100644
--- a/sql_test.go
+++ b/sql_test.go
@@ -15,7 +15,7 @@ func TestScan(t *testing.T) {
invalidTest := "f47ac10b-58cc-0372-8567-0e02b2c3d4"
byteTest := make([]byte, 16)
- byteTestUUID := Must(Parse(stringTest))
+ byteTestUUID := MustParse(stringTest)
copy(byteTest, byteTestUUID[:])
// sunny day tests
@@ -105,7 +105,7 @@ func TestScan(t *testing.T) {
func TestValue(t *testing.T) {
stringTest := "f47ac10b-58cc-0372-8567-0e02b2c3d479"
- uuid := Must(Parse(stringTest))
+ uuid := MustParse(stringTest)
val, _ := uuid.Value()
if val != stringTest {
t.Error("Value() did not return expected string")