Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace github.com/pborman/uuid with github.com/google/uuid #7173

Merged
merged 2 commits into from
Jan 22, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ require (
github.com/go-openapi/spec v0.20.8
github.com/golang/mock v1.6.0
github.com/google/go-cmp v0.6.0
github.com/google/uuid v1.3.1
github.com/gorilla/handlers v1.5.2
github.com/gorilla/mux v1.8.0
github.com/jedib0t/go-pretty/v6 v6.4.7
Expand All @@ -40,7 +41,6 @@ require (
github.com/openshift/oc v0.0.0-alpha.0.0.20220402064836-f1f09a392fd1
github.com/operator-framework/api v0.17.7
github.com/operator-framework/operator-lifecycle-manager v0.21.2
github.com/pborman/uuid v1.2.1
github.com/posener/complete v1.2.3
github.com/redhat-developer/service-binding-operator v1.0.1-0.20211222115357-5b7bbba3bfb3
github.com/sabhiram/go-gitignore v0.0.0-20210923224102-525f6e181f06
Expand Down Expand Up @@ -133,7 +133,6 @@ require (
github.com/google/licensecheck v0.3.1 // indirect
github.com/google/pprof v0.0.0-20210720184732-4bb14d4b1be1 // indirect
github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510 // indirect
github.com/google/uuid v1.3.1 // indirect
github.com/gookit/color v1.5.4 // indirect
github.com/gregjones/httpcache v0.0.0-20190611155906-901d90724c79 // indirect
github.com/hashicorp/errwrap v1.1.0 // indirect
Expand Down
2 changes: 0 additions & 2 deletions go.sum

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 6 additions & 4 deletions pkg/segment/segment.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package segment

import (
"bytes"
"context"
"errors"
"fmt"
Expand All @@ -18,7 +19,7 @@ import (
"github.com/redhat-developer/odo/pkg/config"
scontext "github.com/redhat-developer/odo/pkg/segment/context"

"github.com/pborman/uuid"
"github.com/google/uuid"
"golang.org/x/term"
"gopkg.in/segmentio/analytics-go.v3"
"k8s.io/klog"
Expand Down Expand Up @@ -215,11 +216,12 @@ func GetUserIdentity(telemetryFilePath string) (string, error) {
}

// check if the id is a valid uuid, if not, nil is returned
if uuid.Parse(strings.TrimSpace(string(id))) == nil {
id = []byte(uuid.NewRandom().String())
if err := os.WriteFile(telemetryFilePath, id, 0600); err != nil {
if _, err := uuid.ParseBytes(bytes.TrimSpace(id)); err != nil {
uid := uuid.New()
if err := os.WriteFile(telemetryFilePath, uid[:], 0o600); err != nil {
return "", err
}
id = uid[:]
}
return strings.TrimSpace(string(id)), nil
}
Expand Down
10 changes: 0 additions & 10 deletions vendor/github.com/pborman/uuid/.travis.yml

This file was deleted.

10 changes: 0 additions & 10 deletions vendor/github.com/pborman/uuid/CONTRIBUTING.md

This file was deleted.

1 change: 0 additions & 1 deletion vendor/github.com/pborman/uuid/CONTRIBUTORS

This file was deleted.

27 changes: 0 additions & 27 deletions vendor/github.com/pborman/uuid/LICENSE

This file was deleted.

15 changes: 0 additions & 15 deletions vendor/github.com/pborman/uuid/README.md

This file was deleted.

84 changes: 0 additions & 84 deletions vendor/github.com/pborman/uuid/dce.go

This file was deleted.

13 changes: 0 additions & 13 deletions vendor/github.com/pborman/uuid/doc.go

This file was deleted.

53 changes: 0 additions & 53 deletions vendor/github.com/pborman/uuid/hash.go

This file was deleted.

85 changes: 0 additions & 85 deletions vendor/github.com/pborman/uuid/marshal.go

This file was deleted.

Loading