Skip to content

Commit

Permalink
Refactor UUID generation (#30)
Browse files Browse the repository at this point in the history
Refactor UUID generation to pass from version 1 to version 4 and avoid repeating.
  • Loading branch information
cbrea authored Jun 1, 2021
1 parent 1b4cafb commit 6b1d615
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion steps/common/steps.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ func StoreValueInContext(ctx context.Context, name, value string) error {

// GenerateUUIDInContext generates a UUID and stores it in golium.Context using the key name.
func GenerateUUIDInContext(ctx context.Context, name string) error {
guid, err := uuid.NewUUID()
guid, err := uuid.NewRandom()
if err != nil {
return fmt.Errorf("failed generating UUID: %w", err)
}
Expand Down
2 changes: 1 addition & 1 deletion value.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ var simpleTagFuncs = map[string]func(ctx context.Context) (interface{}, error){
"NOW": func(ctx context.Context) (interface{}, error) { return time.Now().Unix(), nil },
"NULL": func(ctx context.Context) (interface{}, error) { return nil, nil },
"UUID": func(ctx context.Context) (interface{}, error) {
guid, err := uuid.NewUUID()
guid, err := uuid.NewRandom()
if err != nil {
return "", err
}
Expand Down

0 comments on commit 6b1d615

Please sign in to comment.