Skip to content

Commit

Permalink
Fix broken UUID dependency (#87)
Browse files Browse the repository at this point in the history
  • Loading branch information
chilland authored Aug 29, 2018
1 parent 78bde6a commit e6f7e79
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 7 deletions.
4 changes: 2 additions & 2 deletions glide.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@ package: github.com/qntfy/kazaam
import:
- package: github.com/qntfy/jsonparser
version: ^1.0.2
- package: github.com/satori/go.uuid
version: ^1.2.0
- package: github.com/gofrs/uuid
version: ^3.1.0
11 changes: 7 additions & 4 deletions transform/uuid.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package transform
import (
"strings"

uuid "github.com/satori/go.uuid"
uuid "github.com/gofrs/uuid"
)

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

switch version {
case 4:
u = uuid.NewV4()
u, err = uuid.NewV4()
if err != nil {
return nil, err
}

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

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

}
// set the uuid in the appropraite place
// set the uuid in the appropriate place
data, err = setJSONRaw(data, bookend([]byte(u.String()), '"', '"'), k)
if err != nil {
return nil, err
Expand Down
2 changes: 1 addition & 1 deletion transform/uuid_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ package transform
import (
"testing"

uuid "github.com/gofrs/uuid"
"github.com/qntfy/jsonparser"
uuid "github.com/satori/go.uuid"
)

func TestUUIDV4(t *testing.T) {
Expand Down

0 comments on commit e6f7e79

Please sign in to comment.