@@ -3,7 +3,7 @@ package transform
33import (
44 "strings"
55
6- uuid "github.com/satori/go. uuid"
6+ uuid "github.com/gofrs/ uuid"
77)
88
99var (
@@ -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
0 commit comments