Skip to content

Commit

Permalink
golang update to 1.20 (#37)
Browse files Browse the repository at this point in the history
  • Loading branch information
delldubey authored Mar 6, 2023
1 parent 97fd6c8 commit 3a41262
Show file tree
Hide file tree
Showing 6 changed files with 459 additions and 12 deletions.
6 changes: 6 additions & 0 deletions fc_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ import (
"testing"
"time"

intpowerpath "github.com/dell/gobrick/internal/powerpath"

"github.com/dell/gobrick/internal/mockhelper"
intmultipath "github.com/dell/gobrick/internal/multipath"
intscsi "github.com/dell/gobrick/internal/scsi"
Expand All @@ -47,6 +49,7 @@ var (
type fcFields struct {
baseConnector *baseConnector
multipath *intmultipath.MockMultipath
powerpath *intpowerpath.MockPowerpath
scsi *intscsi.MockSCSI
filePath *wrp.MockLimitedFilepath
os *wrp.MockLimitedOS
Expand All @@ -59,12 +62,14 @@ func getDefaultFCFields(ctrl *gomock.Controller) fcFields {
con := NewFCConnector(FCConnectorParams{})
bc := con.baseConnector
mpMock := intmultipath.NewMockMultipath(ctrl)
ppMock := intpowerpath.NewMockPowerpath(ctrl)
scsiMock := intscsi.NewMockSCSI(ctrl)
bc.multipath = mpMock
bc.scsi = scsiMock
f := fcFields{
baseConnector: bc,
multipath: mpMock,
powerpath: ppMock,
scsi: scsiMock,
filePath: wrp.NewMockLimitedFilepath(ctrl),
os: wrp.NewMockLimitedOS(ctrl),
Expand Down Expand Up @@ -328,6 +333,7 @@ func TestFCConnector_ConnectVolume(t *testing.T) {
fc := &FCConnector{
baseConnector: tt.fields.baseConnector,
multipath: tt.fields.multipath,
powerpath: tt.fields.powerpath,
scsi: tt.fields.scsi,
filePath: tt.fields.filePath,
os: tt.fields.os,
Expand Down
13 changes: 7 additions & 6 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,19 +1,20 @@
module github.com/dell/gobrick

go 1.19
go 1.20

require (
github.com/dell/goiscsi v1.6.0
github.com/dell/gonvme v1.3.0
github.com/dell/goiscsi v1.7.0
github.com/dell/gonvme v1.4.0
github.com/golang/mock v1.3.1
github.com/sirupsen/logrus v1.8.1
github.com/stretchr/testify v1.4.0
github.com/sirupsen/logrus v1.9.0
github.com/stretchr/testify v1.7.0
golang.org/x/sync v0.0.0-20190423024810-112230192c58
)

require (
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
golang.org/x/sys v0.1.0 // indirect
golang.org/x/sys v0.6.0 // indirect
gopkg.in/yaml.v2 v2.2.2 // indirect
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c // indirect
)
13 changes: 13 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -3,29 +3,42 @@ github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/dell/goiscsi v1.6.0 h1:sdffJtVkjXgmcFJEkyv0sbjde24HHc/6qCRVAV4wUho=
github.com/dell/goiscsi v1.6.0/go.mod h1:hNS7UZhjblSykVRHPv8slHNL2RdbR/1rtfKOckld598=
github.com/dell/goiscsi v1.7.0 h1:LL/6v7uaN48Lc8d3G8t/tLZI+EuJGBRQ7NZLgJrg3RQ=
github.com/dell/goiscsi v1.7.0/go.mod h1:l3PNZbHbYKDg50e5kdJWrf5+lOxcM5+8PjMr9HibvLs=
github.com/dell/gonvme v1.3.0 h1:IkcZLesdBWKomawZkO2sI1H41xG7lLxHQtanx/Wyku4=
github.com/dell/gonvme v1.3.0/go.mod h1:qVUW4Z4ijkD5xXyn1Fl3h8pMcMBH+GjrvZy4OsQNRYs=
github.com/dell/gonvme v1.4.0 h1:SK94ETt0pYZbaKkRJOcq81TbrzC38ufBX+w4uKwJnks=
github.com/dell/gonvme v1.4.0/go.mod h1:fIu54BDTyIu8JOTXo6Q0BqMF1tOjpO+wKXVXjLReR2o=
github.com/golang/mock v1.3.1 h1:qGJ6qTW+x6xX/my+8YUVl4WNpX9B7+/l2tRsHGZ7f2s=
github.com/golang/mock v1.3.1/go.mod h1:sBzyDLLjw3U8JLTeZvSv8jJB+tU5PVekmnlKIyFUx0Y=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/sirupsen/logrus v1.8.1 h1:dJKuHgqk1NNQlqoA6BTlM1Wf9DOH3NBjQyu0h9+AZZE=
github.com/sirupsen/logrus v1.8.1/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0=
github.com/sirupsen/logrus v1.9.0 h1:trlNQbNUG3OdDrDil03MCb1H2o9nJ1x4/5LYw7byDE0=
github.com/sirupsen/logrus v1.9.0/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ=
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs=
github.com/stretchr/testify v1.4.0 h1:2E4SXV/wtOkTonXsotYi4li6zVWxYlZuYNCXe9XRJyk=
github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4=
github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5CcY=
github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
golang.org/x/sync v0.0.0-20190423024810-112230192c58 h1:8gQV6CLnAEikrhgkHFbMAEhagSSnXWGV915qUMm9mrU=
golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.1.0 h1:kunALQeHf1/185U1i0GOB/fy1IPRDDpuoOOqRReG57U=
golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.6.0 h1:MVltZSvRTcU2ljQOhs94SXPftV6DCNnZViHeQps87pQ=
golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/tools v0.0.0-20190425150028-36563e24a262/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/yaml.v2 v2.2.2 h1:ZCJp+EgiOT7lHqUV2J862kp8Qj64Jo6az82+3Td9dZw=
gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c h1:dUUwHk2QECo/6vqA44rthZ8ie2QXMNeKRTHCNY2nXvo=
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
77 changes: 77 additions & 0 deletions internal/powerpath/powerpath_mock.go

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

14 changes: 8 additions & 6 deletions pkg/multipath/multipath.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,18 +56,20 @@ type Multipath struct {
}

// AddWWID add wwid to the list of know multipath wwids.
// This has the effect of multipathd being willing to create a dm for a
// multipath even when there's only 1 device.
//
// This has the effect of multipathd being willing to create a dm for a
// multipath even when there's only 1 device.
func (mp *Multipath) AddWWID(ctx context.Context, wwid string) error {
defer tracer.TraceFuncCall(ctx, "multipath.AddWWID")()
return mp.addWWID(ctx, wwid)
}

// AddPath add a path to multipathd for monitoring.
// This has the effect of multipathd checking an already checked device
// for multipath.
// Together with `multipath_add_wwid` we can create a multipath when
// there's only 1 path.
//
// This has the effect of multipathd checking an already checked device
// for multipath.
// Together with `multipath_add_wwid` we can create a multipath when
// there's only 1 path.
func (mp *Multipath) AddPath(ctx context.Context, path string) error {
defer tracer.TraceFuncCall(ctx, "multipath.AddPath")()
return mp.changePath(ctx, "add", path)
Expand Down
Loading

0 comments on commit 3a41262

Please sign in to comment.