Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: use MustParse("xxx") instead of Must(Parse("xxxx")) #106

Merged
merged 4 commits into from
Feb 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 4 additions & 4 deletions hash.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion json_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
4 changes: 2 additions & 2 deletions sql_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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")
Expand Down