Skip to content
This repository has been archived by the owner on Oct 9, 2023. It is now read-only.

Commit

Permalink
replaced github.com/satori/go.uuid with github.com/gofrs/uuid (#101)
Browse files Browse the repository at this point in the history
Signed-off-by: Daniel Rammer <daniel@union.ai>
  • Loading branch information
hamersaw committed Mar 20, 2023
1 parent b526b0c commit 25c0a10
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
3 changes: 1 addition & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@ require (
github.com/Selvatico/go-mocket v1.0.7
github.com/flyteorg/flyteidl v1.3.6
github.com/flyteorg/flytestdlib v1.0.15
github.com/gofrs/uuid v4.2.0+incompatible
github.com/golang/glog v1.0.0
github.com/golang/protobuf v1.5.2
github.com/jackc/pgconn v1.10.1
github.com/mitchellh/mapstructure v1.4.3
github.com/satori/go.uuid v1.2.0
github.com/spf13/cobra v1.4.0
github.com/spf13/pflag v1.0.5
github.com/stretchr/testify v1.7.1
Expand Down Expand Up @@ -46,7 +46,6 @@ require (
github.com/fsnotify/fsnotify v1.5.1 // indirect
github.com/ghodss/yaml v1.0.0 // indirect
github.com/go-logr/logr v0.4.0 // indirect
github.com/gofrs/uuid v4.2.0+incompatible // indirect
github.com/golang-jwt/jwt/v4 v4.4.1 // indirect
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
github.com/google/go-cmp v0.5.8 // indirect
Expand Down
1 change: 0 additions & 1 deletion go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -485,7 +485,6 @@ github.com/rs/xid v1.2.1/go.mod h1:+uKXf+4Djp6Md1KODXJxgGQPKngRmWyn10oCKFzNHOQ=
github.com/rs/zerolog v1.13.0/go.mod h1:YbFCdg8HfsridGWAh22vktObvhZbQsZXe4/zB0OKkWU=
github.com/rs/zerolog v1.15.0/go.mod h1:xYTKnLHcpfU2225ny5qZjxnj9NvkumZYjJHlAThCjNc=
github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM=
github.com/satori/go.uuid v1.2.0 h1:0uYX9dsZ2yD7q2RtLRtPSdGDWzjeM3TbMJP9utgA0ww=
github.com/satori/go.uuid v1.2.0/go.mod h1:dA0hQrYB0VpLJoorglMZABFdXlWrHn1NEOzdhQKdks0=
github.com/shopspring/decimal v0.0.0-20180709203117-cd690d0c9e24/go.mod h1:M+9NzErvs504Cn4c5DxATwIqPbtswREoFCre64PpcG4=
github.com/shopspring/decimal v1.2.0 h1:abSATXmQEYyShuxI4/vyW3tV1MrKAJzCZ/0zLUXYbsQ=
Expand Down
8 changes: 6 additions & 2 deletions pkg/repositories/models/dataset.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package models

import (
uuid "github.com/satori/go.uuid"
"github.com/gofrs/uuid"
"gorm.io/gorm"
)

Expand Down Expand Up @@ -29,7 +29,11 @@ type PartitionKey struct {
// BeforeCreate so that we set the UUID in golang rather than from a DB function call
func (dataset *Dataset) BeforeCreate(tx *gorm.DB) error {
if dataset.UUID == "" {
generated := uuid.NewV4()
generated, err := uuid.NewV4()
if err != nil {
return err
}

tx.Model(dataset).Update("UUID", generated)
}
return nil
Expand Down

0 comments on commit 25c0a10

Please sign in to comment.