Skip to content

Commit e6f7e79

Browse files
authored
Fix broken UUID dependency (#87)
1 parent 78bde6a commit e6f7e79

3 files changed

Lines changed: 10 additions & 7 deletions

File tree

glide.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@ package: github.com/qntfy/kazaam
22
import:
33
- package: github.com/qntfy/jsonparser
44
version: ^1.0.2
5-
- package: github.com/satori/go.uuid
6-
version: ^1.2.0
5+
- package: github.com/gofrs/uuid
6+
version: ^3.1.0

transform/uuid.go

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ package transform
33
import (
44
"strings"
55

6-
uuid "github.com/satori/go.uuid"
6+
uuid "github.com/gofrs/uuid"
77
)
88

99
var (
@@ -30,7 +30,10 @@ func UUID(spec *Config, data []byte) ([]byte, error) {
3030

3131
switch version {
3232
case 4:
33-
u = uuid.NewV4()
33+
u, err = uuid.NewV4()
34+
if err != nil {
35+
return nil, err
36+
}
3437

3538
case 3, 5:
3639
// choose the correct UUID function
@@ -57,7 +60,7 @@ func UUID(spec *Config, data []byte) ([]byte, error) {
5760
// generate the required namespace
5861
u, err = namespaceFromString(namespaceString)
5962
if err != nil {
60-
return nil, SpecError("namespace is not a valid UUID or is not DNS, URL, OID, X500")
63+
return nil, SpecError("Namespace is not a valid UUID or is not DNS, URL, OID, X500")
6164
}
6265

6366
// loop over the names field
@@ -80,7 +83,7 @@ func UUID(spec *Config, data []byte) ([]byte, error) {
8083
return nil, versionError
8184

8285
}
83-
// set the uuid in the appropraite place
86+
// set the uuid in the appropriate place
8487
data, err = setJSONRaw(data, bookend([]byte(u.String()), '"', '"'), k)
8588
if err != nil {
8689
return nil, err

transform/uuid_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ package transform
33
import (
44
"testing"
55

6+
uuid "github.com/gofrs/uuid"
67
"github.com/qntfy/jsonparser"
7-
uuid "github.com/satori/go.uuid"
88
)
99

1010
func TestUUIDV4(t *testing.T) {

0 commit comments

Comments
 (0)