Skip to content

Commit 7a5fc44

Browse files
committed
Removed gofr/uuid and moved to 1.22 compile
1 parent 5483ab3 commit 7a5fc44

File tree

8 files changed

+19
-19
lines changed

8 files changed

+19
-19
lines changed

command/ota/massupload_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@ import (
2626

2727
otaapi "github.com/arduino/arduino-cloud-cli/internal/ota-api"
2828
iotclient "github.com/arduino/iot-client-go/v2"
29-
"github.com/gofrs/uuid"
3029
"github.com/stretchr/testify/assert"
30+
"github.com/google/uuid"
3131
)
3232

3333
const testFilename = "testdata/empty.bin"
@@ -45,7 +45,7 @@ type otaStatusGetterTest struct{}
4545

4646
func (s *otaStatusGetterTest) GetOtaLastStatusByDeviceID(deviceID string) (*otaapi.OtaStatusList, error) {
4747
ota := otaapi.Ota{
48-
ID: uuid.Must(uuid.NewV4()).String(),
48+
ID: uuid.New().String(),
4949
Status: "in_progress",
5050
StartedAt: "2021-09-01T12:00:00Z",
5151
}

command/template/apply.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ import (
3232
"github.com/arduino/arduino-cloud-cli/internal/iot"
3333
storageapi "github.com/arduino/arduino-cloud-cli/internal/storage-api"
3434
iotclient "github.com/arduino/iot-client-go/v2"
35-
"github.com/gofrs/uuid"
35+
"github.com/google/uuid"
3636
"github.com/sirupsen/logrus"
3737
)
3838

@@ -51,7 +51,7 @@ func ApplyCustomTemplates(cred *config.Credentials, templateId, deviceId, prefix
5151

5252
feedback.Printf("Applying template %s to device %s", templateId, deviceId)
5353

54-
templateIdUUID, err := uuid.FromString(templateId)
54+
templateIdUUID, err := uuid.Parse(templateId)
5555
if err != nil {
5656
return fmt.Errorf("invalid template id: %s", templateId)
5757
}

go.mod

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
module github.com/arduino/arduino-cloud-cli
22

3-
go 1.19
3+
go 1.22
44

55
require (
66
github.com/arduino/arduino-cli v0.0.0-20221116144942-76251df9241a
77
github.com/arduino/go-paths-helper v1.7.0
88
github.com/arduino/go-win32-utils v1.0.0
99
github.com/arduino/iot-client-go/v2 v2.0.3
10-
github.com/gofrs/uuid v4.2.0+incompatible
1110
github.com/google/go-cmp v0.6.0
11+
github.com/google/uuid v1.6.0
1212
github.com/howeyc/crc16 v0.0.0-20171223171357-2b2a61e366a6
1313
github.com/icza/bitio v1.1.0
1414
github.com/manifoldco/promptui v0.9.0

go.sum

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -74,8 +74,6 @@ github.com/arduino/go-properties-orderedmap v1.7.1 h1:HQ9Pn/mk3+XyfrE39EEvaZwJkr
7474
github.com/arduino/go-properties-orderedmap v1.7.1/go.mod h1:DKjD2VXY/NZmlingh4lSFMEYCVubfeArCsGPGDwb2yk=
7575
github.com/arduino/go-win32-utils v1.0.0 h1:/cXB86sOJxOsCHP7sQmXGLkdValwJt56mIwOHYxgQjQ=
7676
github.com/arduino/go-win32-utils v1.0.0/go.mod h1:0jqM7doGEAs6DaJCxxhLBUDS5OawrqF48HqXkcEie/Q=
77-
github.com/arduino/iot-client-go/v2 v2.0.2 h1:5Zh8ZtZ+O8WBlvXvbA8Sla18Fvaw+QdQsz0X7DK4XLU=
78-
github.com/arduino/iot-client-go/v2 v2.0.2/go.mod h1:kwX4B2AVEWl5ug94QbQ087xbvLFa9Co//jhbM/Z2eSQ=
7977
github.com/arduino/iot-client-go/v2 v2.0.3 h1:/mYkInEgr2a4s3bSFhjCzynBApPcYlpDwsuTQiyMbag=
8078
github.com/arduino/iot-client-go/v2 v2.0.3/go.mod h1:kwX4B2AVEWl5ug94QbQ087xbvLFa9Co//jhbM/Z2eSQ=
8179
github.com/armon/circbuf v0.0.0-20150827004946-bbbad097214e/go.mod h1:3U/XgcO3hCbHZ8TKRvWD2dDTCfh9M9ya+I9JpbB7O8o=
@@ -165,8 +163,6 @@ github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9
165163
github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V4qmtdjCk=
166164
github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY=
167165
github.com/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA=
168-
github.com/gofrs/uuid v4.2.0+incompatible h1:yyYWMnhkhrKwwr8gAOcOCYxOOscHgDS9yZgBrnJfGa0=
169-
github.com/gofrs/uuid v4.2.0+incompatible/go.mod h1:b2aQJv3Z4Fp6yNu3cdSllBxTCLRxnplIgP/c0N/04lM=
170166
github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ=
171167
github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q=
172168
github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q=
@@ -240,6 +236,8 @@ github.com/google/pprof v0.0.0-20210609004039-a478d1d731e9/go.mod h1:kpwsk12EmLe
240236
github.com/google/pprof v0.0.0-20210720184732-4bb14d4b1be1/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE=
241237
github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI=
242238
github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
239+
github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0=
240+
github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
243241
github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg=
244242
github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk=
245243
github.com/googleapis/gax-go/v2 v2.1.0/go.mod h1:Q3nei7sK6ybPYH7twZdmQpAd1MKb7pfu6SK+H1/DsU0=
@@ -312,6 +310,7 @@ github.com/juju/errors v0.0.0-20210818161939-5560c4c073ff h1:WLHwK6yMswDvGUNrkxp
312310
github.com/juju/errors v0.0.0-20210818161939-5560c4c073ff/go.mod h1:i1eL7XREII6aHpQ2gApI/v6FkVUDEBremNkcBCKYAcY=
313311
github.com/juju/loggo v0.0.0-20170605014607-8232ab8918d9/go.mod h1:vgyd7OREkbtVEN/8IXZe5Ooef3LQePvuBm9UWj6ZL8U=
314312
github.com/juju/loggo v0.0.0-20190526231331-6e530bcce5d8 h1:UUHMLvzt/31azWTN/ifGWef4WUqvXk0iRqdhdy/2uzI=
313+
github.com/juju/loggo v0.0.0-20190526231331-6e530bcce5d8/go.mod h1:vgyd7OREkbtVEN/8IXZe5Ooef3LQePvuBm9UWj6ZL8U=
315314
github.com/juju/retry v0.0.0-20160928201858-1998d01ba1c3/go.mod h1:OohPQGsr4pnxwD5YljhQ+TZnuVRYpa5irjugL1Yuif4=
316315
github.com/juju/testing v0.0.0-20180517134105-72703b1e95eb/go.mod h1:63prj8cnj0tU0S9OHjGJn+b1h0ZghCndfnbQolrYTwA=
317316
github.com/juju/testing v0.0.0-20200510222523-6c8c298c77a0 h1:+WWUkhnTjV6RNOxkcwk79qrjeyHEHvBzlneueBsatX4=
@@ -333,6 +332,7 @@ github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
333332
github.com/kr/pty v1.1.8/go.mod h1:O1sed60cT9XZ5uDucP5qwvh+TE3NnUj51EiZO/lmSfw=
334333
github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=
335334
github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
335+
github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE=
336336
github.com/leonelquinteros/gotext v1.4.0 h1:2NHPCto5IoMXbrT0bldPrxj0qM5asOCwtb1aUQZ1tys=
337337
github.com/leonelquinteros/gotext v1.4.0/go.mod h1:yZGXREmoGTtBvZHNcc+Yfug49G/2spuF/i/Qlsvz1Us=
338338
github.com/lyft/protoc-gen-star v0.5.3/go.mod h1:V0xaHgaf5oCCqmcxYcWiDfTiKsZsRc87/1qhoTACD8w=
@@ -624,6 +624,7 @@ golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJ
624624
golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
625625
golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
626626
golang.org/x/sync v0.6.0 h1:5BMeUDZ7vkXGfEr1x9B4bRcTH4lpkTkpdh0T/J+qjbQ=
627+
golang.org/x/sync v0.6.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk=
627628
golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
628629
golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
629630
golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
@@ -697,6 +698,7 @@ golang.org/x/sys v0.16.0 h1:xWw16ngr6ZMtmxDyKyIgsE93KNKz5HKmMa3b8ALHidU=
697698
golang.org/x/sys v0.16.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
698699
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
699700
golang.org/x/term v0.16.0 h1:m+B6fahuftsE9qjo0VWp2FW0mB3MTJvR0BaMQrq0pmE=
701+
golang.org/x/term v0.16.0/go.mod h1:yn7UURbUtPyrVJPGPq404EukNFxcm/foM+bV/bfcDsY=
700702
golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
701703
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
702704
golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
@@ -934,6 +936,7 @@ gopkg.in/ini.v1 v1.66.2 h1:XfR1dOYubytKy4Shzc2LHrrGhU0lDCfDGG1yLPmpgsI=
934936
gopkg.in/ini.v1 v1.66.2/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k=
935937
gopkg.in/mgo.v2 v2.0.0-20160818015218-f2b6f6c918c4/go.mod h1:yeKp02qBN3iKW1OzL3MGk2IdtZzaj7SFntXj72NppTA=
936938
gopkg.in/mgo.v2 v2.0.0-20180705113604-9856a29383ce h1:xcEWjVhvbDy+nHP67nPDDpbYrY+ILlfndk4bRioVHaU=
939+
gopkg.in/mgo.v2 v2.0.0-20180705113604-9856a29383ce/go.mod h1:yeKp02qBN3iKW1OzL3MGk2IdtZzaj7SFntXj72NppTA=
937940
gopkg.in/src-d/go-billy.v4 v4.3.2 h1:0SQA1pRztfTFx2miS8sA97XvooFeNOmvUenF4o0EcVg=
938941
gopkg.in/src-d/go-billy.v4 v4.3.2/go.mod h1:nDjArDMp+XMs1aFAESLRjfGSgfvoYN0hDfzEk0GjC98=
939942
gopkg.in/src-d/go-git-fixtures.v3 v3.5.0 h1:ivZFOIltbce2Mo8IjzUHAFoq/IylO9WHhNOAJK+LsJg=

internal/storage-api/client.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ import (
3232

3333
"github.com/arduino/arduino-cloud-cli/config"
3434
"github.com/arduino/arduino-cloud-cli/internal/iot"
35-
"github.com/gofrs/uuid"
35+
"github.com/google/uuid"
3636
"github.com/sirupsen/logrus"
3737
"golang.org/x/oauth2"
3838
)

internal/storage-api/dto.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ import (
2121
"time"
2222

2323
"github.com/arduino/arduino-cli/table"
24-
"github.com/gofrs/uuid"
24+
"github.com/google/uuid"
2525
)
2626

2727
type (

internal/template/load.go

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ import (
2626
"os"
2727

2828
iotclient "github.com/arduino/iot-client-go/v2"
29-
"github.com/gofrs/uuid"
29+
"github.com/google/uuid"
3030
"gopkg.in/yaml.v3"
3131
)
3232

@@ -98,10 +98,7 @@ func LoadDashboard(ctx context.Context, file string, override map[string]string,
9898
// Adapt the template to the dashboard struct
9999
for i, widget := range template.Widgets {
100100
// Generate and set a uuid for each widget
101-
id, err := uuid.NewV4()
102-
if err != nil {
103-
return nil, fmt.Errorf("cannot create a uuid for new widget: %w", err)
104-
}
101+
id := uuid.New()
105102
widget.Id = id.String()
106103
filterWidgetOptions(widget.Options)
107104
// Even if the widget has no options, its field should exist

internal/template/load_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ import (
2222
"testing"
2323

2424
iotclient "github.com/arduino/iot-client-go/v2"
25-
"github.com/gofrs/uuid"
25+
"github.com/google/uuid"
2626
"github.com/google/go-cmp/cmp"
2727
)
2828

@@ -228,7 +228,7 @@ func TestLoadDashboard(t *testing.T) {
228228
for i := range got.Widgets {
229229
// check widget id generation
230230
id := got.Widgets[i].Id
231-
_, err := uuid.FromString(id)
231+
_, err := uuid.Parse(id)
232232
if err != nil {
233233
t.Errorf("Widget ID is not a valid UUID: %s", id)
234234
}

0 commit comments

Comments
 (0)