Skip to content

Commit c90fbe2

Browse files
committed
Replace github.com/pborman/uuid with github.com/google/uuid
`github.com/pborman/uuid` is no longer being actively maintained (last release was 2019). So we should just use the newer `github.com/google/uuid`. Signed-off-by: Eng Zer Jun <engzerjun@gmail.com>
1 parent 47037ff commit c90fbe2

File tree

20 files changed

+7
-727
lines changed

20 files changed

+7
-727
lines changed

go.mod

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ require (
2323
github.com/go-openapi/spec v0.20.8
2424
github.com/golang/mock v1.6.0
2525
github.com/google/go-cmp v0.6.0
26+
github.com/google/uuid v1.3.1
2627
github.com/gorilla/handlers v1.5.2
2728
github.com/gorilla/mux v1.8.0
2829
github.com/jedib0t/go-pretty/v6 v6.4.7
@@ -40,7 +41,6 @@ require (
4041
github.com/openshift/oc v0.0.0-alpha.0.0.20220402064836-f1f09a392fd1
4142
github.com/operator-framework/api v0.17.7
4243
github.com/operator-framework/operator-lifecycle-manager v0.21.2
43-
github.com/pborman/uuid v1.2.1
4444
github.com/posener/complete v1.2.3
4545
github.com/redhat-developer/service-binding-operator v1.0.1-0.20211222115357-5b7bbba3bfb3
4646
github.com/sabhiram/go-gitignore v0.0.0-20210923224102-525f6e181f06
@@ -133,7 +133,6 @@ require (
133133
github.com/google/licensecheck v0.3.1 // indirect
134134
github.com/google/pprof v0.0.0-20210720184732-4bb14d4b1be1 // indirect
135135
github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510 // indirect
136-
github.com/google/uuid v1.3.1 // indirect
137136
github.com/gookit/color v1.5.4 // indirect
138137
github.com/gregjones/httpcache v0.0.0-20190611155906-901d90724c79 // indirect
139138
github.com/hashicorp/errwrap v1.1.0 // indirect

go.sum

Lines changed: 0 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pkg/segment/segment.go

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package segment
22

33
import (
4+
"bytes"
45
"context"
56
"errors"
67
"fmt"
@@ -18,7 +19,7 @@ import (
1819
"github.com/redhat-developer/odo/pkg/config"
1920
scontext "github.com/redhat-developer/odo/pkg/segment/context"
2021

21-
"github.com/pborman/uuid"
22+
"github.com/google/uuid"
2223
"golang.org/x/term"
2324
"gopkg.in/segmentio/analytics-go.v3"
2425
"k8s.io/klog"
@@ -215,11 +216,12 @@ func GetUserIdentity(telemetryFilePath string) (string, error) {
215216
}
216217

217218
// check if the id is a valid uuid, if not, nil is returned
218-
if uuid.Parse(strings.TrimSpace(string(id))) == nil {
219-
id = []byte(uuid.NewRandom().String())
220-
if err := os.WriteFile(telemetryFilePath, id, 0600); err != nil {
219+
if _, err := uuid.ParseBytes(bytes.TrimSpace(id)); err != nil {
220+
uid := uuid.New()
221+
if err := os.WriteFile(telemetryFilePath, uid[:], 0o600); err != nil {
221222
return "", err
222223
}
224+
id = uid[:]
223225
}
224226
return strings.TrimSpace(string(id)), nil
225227
}

vendor/github.com/pborman/uuid/.travis.yml

Lines changed: 0 additions & 10 deletions
This file was deleted.

vendor/github.com/pborman/uuid/CONTRIBUTING.md

Lines changed: 0 additions & 10 deletions
This file was deleted.

vendor/github.com/pborman/uuid/CONTRIBUTORS

Lines changed: 0 additions & 1 deletion
This file was deleted.

vendor/github.com/pborman/uuid/LICENSE

Lines changed: 0 additions & 27 deletions
This file was deleted.

vendor/github.com/pborman/uuid/README.md

Lines changed: 0 additions & 15 deletions
This file was deleted.

vendor/github.com/pborman/uuid/dce.go

Lines changed: 0 additions & 84 deletions
This file was deleted.

vendor/github.com/pborman/uuid/doc.go

Lines changed: 0 additions & 13 deletions
This file was deleted.

vendor/github.com/pborman/uuid/hash.go

Lines changed: 0 additions & 53 deletions
This file was deleted.

vendor/github.com/pborman/uuid/marshal.go

Lines changed: 0 additions & 85 deletions
This file was deleted.

0 commit comments

Comments
 (0)