Skip to content

Commit 4752366

Browse files
committed
Switch to google/uuid for UUID generation
Signed-off-by: Stéphane Graber <[email protected]>
1 parent c35c925 commit 4752366

File tree

3 files changed

+4
-8
lines changed

3 files changed

+4
-8
lines changed

go.mod

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,12 @@ require (
66
github.com/armon/go-proxyproto v0.1.0
77
github.com/fsnotify/fsnotify v1.9.0
88
github.com/goccy/go-yaml v1.17.1
9+
github.com/google/uuid v1.6.0
910
github.com/gorilla/websocket v1.5.3
1011
github.com/inconshreveable/log15 v2.16.0+incompatible
1112
github.com/lib/pq v1.10.9
1213
github.com/lxc/incus/v6 v6.12.0
1314
github.com/olekukonko/tablewriter v0.0.5
14-
github.com/pborman/uuid v1.2.1
1515
github.com/prometheus/client_golang v1.22.0
1616
github.com/urfave/cli/v2 v2.27.6
1717
)
@@ -21,7 +21,6 @@ require (
2121
github.com/cespare/xxhash/v2 v2.3.0 // indirect
2222
github.com/cpuguy83/go-md2man/v2 v2.0.7 // indirect
2323
github.com/go-stack/stack v1.8.1 // indirect
24-
github.com/google/uuid v1.6.0 // indirect
2524
github.com/mattn/go-colorable v0.1.14 // indirect
2625
github.com/mattn/go-isatty v0.0.20 // indirect
2726
github.com/mattn/go-runewidth v0.0.16 // indirect

go.sum

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ github.com/goccy/go-yaml v1.17.1 h1:LI34wktB2xEE3ONG/2Ar54+/HJVBriAGJ55PHls4YuY=
1818
github.com/goccy/go-yaml v1.17.1/go.mod h1:XBurs7gK8ATbW4ZPGKgcbrY1Br56PdM69F7LkFRi1kA=
1919
github.com/google/go-cmp v0.7.0 h1:wk8382ETsv4JYUZwIsn6YpYiWiBsYLSJiTsyBybVuN8=
2020
github.com/google/go-cmp v0.7.0/go.mod h1:pXiqmnSA92OHEEa9HXL2W4E7lf9JzCmGVUdgjX3N/iU=
21-
github.com/google/uuid v1.0.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
2221
github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0=
2322
github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
2423
github.com/gorilla/websocket v1.5.3 h1:saDtZ6Pbx/0u+bgYQ3q96pZgCzfhKXGPqt7kZ72aNNg=
@@ -44,8 +43,6 @@ github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 h1:C3w9PqII01/Oq
4443
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ=
4544
github.com/olekukonko/tablewriter v0.0.5 h1:P2Ga83D34wi1o9J6Wh1mRuqd4mF/x/lgBS7N7AbDhec=
4645
github.com/olekukonko/tablewriter v0.0.5/go.mod h1:hPp6KlRPjbx+hW8ykQs1w3UBbZlj6HuIJcUGPhkA7kY=
47-
github.com/pborman/uuid v1.2.1 h1:+ZZIw58t/ozdjRaXh/3awHfmWRbzYxJoAdNJxe/3pvw=
48-
github.com/pborman/uuid v1.2.1/go.mod h1:X/NO0urCmaxf9VXbdlT7C2Yzkj2IKimNn4k+gtPdI/k=
4946
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
5047
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 h1:Jamvg5psRIccs7FGNTlIRMkT8wgtp5eCXdBlqhYGL6U=
5148
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=

internal/rest/api_events.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,10 @@ import (
1212
"sync"
1313
"time"
1414

15+
"github.com/google/uuid"
1516
"github.com/gorilla/websocket"
1617
"github.com/inconshreveable/log15"
1718
"github.com/lxc/incus/v6/shared/ws"
18-
"github.com/pborman/uuid"
1919

2020
"github.com/nsec/askgod/api"
2121
"github.com/nsec/askgod/internal/utils"
@@ -179,7 +179,7 @@ func (r *rest) getEvents(writer http.ResponseWriter, request *http.Request, logg
179179
// Prepare the listener
180180
listener.active = make(chan bool, 1)
181181
listener.connection = c
182-
listener.id = uuid.NewRandom().String()
182+
listener.id = uuid.New().String()
183183
listener.messageTypes = eventTypes
184184
listener.teamid = teamid
185185

@@ -380,7 +380,7 @@ func (r *rest) forwardEvents(peer string) {
380380
listener := eventListener{
381381
connection: conn,
382382
active: make(chan bool, 1),
383-
id: uuid.NewRandom().String(),
383+
id: uuid.New().String(),
384384
peer: true,
385385
teamid: -1,
386386
}

0 commit comments

Comments
 (0)