From 584c2269c7b51d698976c7df6f82102c29ecf920 Mon Sep 17 00:00:00 2001 From: Niladri Halder Date: Tue, 25 Jul 2023 04:48:04 +0000 Subject: [PATCH] feat(mod): update Go version Signed-off-by: Niladri Halder --- app/backing_disable.go | 1 + controller/rest/stats.go | 2 +- error-inject/default.go | 1 + error-inject/inject.go | 1 + frontend/gotgt/frontend.go | 2 +- go.mod | 45 +++++++++++++++++++++++++++----------- go.sum | 5 ----- replica/backup.go | 2 +- replica/replica.go | 4 ++-- rpc/client.go | 20 ++++++++--------- 10 files changed, 50 insertions(+), 33 deletions(-) diff --git a/app/backing_disable.go b/app/backing_disable.go index c2fd614f..fab18b2a 100644 --- a/app/backing_disable.go +++ b/app/backing_disable.go @@ -1,3 +1,4 @@ +//go:build !qcow // +build !qcow /* diff --git a/controller/rest/stats.go b/controller/rest/stats.go index bb324829..0e6c57f3 100644 --- a/controller/rest/stats.go +++ b/controller/rest/stats.go @@ -26,7 +26,7 @@ import ( "github.com/rancher/go-rancher/api" ) -//ListJournal flushes operation journal (replica read/write, ping, etc.) accumulated since previous flush +// ListJournal flushes operation journal (replica read/write, ping, etc.) accumulated since previous flush func (s *Server) ListJournal(rw http.ResponseWriter, req *http.Request) error { var input JournalInput apiContext := api.GetApiContext(req) diff --git a/error-inject/default.go b/error-inject/default.go index 798cc4c2..c2df5f49 100644 --- a/error-inject/default.go +++ b/error-inject/default.go @@ -1,3 +1,4 @@ +//go:build !debug // +build !debug /* diff --git a/error-inject/inject.go b/error-inject/inject.go index f712c402..1d36b33a 100644 --- a/error-inject/inject.go +++ b/error-inject/inject.go @@ -1,3 +1,4 @@ +//go:build debug // +build debug /* diff --git a/frontend/gotgt/frontend.go b/frontend/gotgt/frontend.go index a0409624..dbaca808 100644 --- a/frontend/gotgt/frontend.go +++ b/frontend/gotgt/frontend.go @@ -161,7 +161,7 @@ func (t *goTgt) Stats() types.Stats { return (types.Stats)(t.targetDriver.Stats()) } -// Resize is called to resize the volume +// Resize is called to resize the volume func (t *goTgt) Resize(size uint64) error { if !t.isUp { return fmt.Errorf("Volume is not up") diff --git a/go.mod b/go.mod index 86da952d..43413764 100644 --- a/go.mod +++ b/go.mod @@ -1,28 +1,18 @@ module github.com/openebs/jiva -go 1.13 +go 1.19 require ( - github.com/Azure/go-ansiterm v0.0.0-20170929234023-d6e3b3328b78 // indirect - github.com/Microsoft/go-winio v0.5.0 // indirect - github.com/containerd/containerd v1.3.4 // indirect - github.com/docker/distribution v2.7.1+incompatible // indirect github.com/docker/docker v17.12.0-ce-rc1.0.20200531234253-77e06fda0c94+incompatible github.com/docker/go-connections v0.4.0 github.com/docker/go-units v0.4.0 github.com/frostschutz/go-fibmap v0.0.0-20160825162329-b32c231bfe6a github.com/google/uuid v1.2.0 - github.com/gorilla/context v1.1.1 // indirect github.com/gorilla/handlers v1.4.2 github.com/gorilla/mux v1.7.4 - github.com/gorilla/websocket v1.4.1 // indirect github.com/gostor/gotgt v0.2.1-0.20210817044456-e5d5366e2b59 github.com/kubernetes-csi/csi-lib-iscsi v0.0.0-20200118015005-959f12c91ca8 - github.com/morikuni/aec v1.0.0 // indirect github.com/natefinch/lumberjack v2.0.0+incompatible - github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e // indirect - github.com/opencontainers/go-digest v1.0.0 // indirect - github.com/opencontainers/image-spec v1.0.1 // indirect github.com/openebs/sparse-tools v1.1.0 github.com/prometheus/client_golang v1.5.1 github.com/rancher/go-rancher v0.1.1-0.20190307222549-9756097e5e4c @@ -30,11 +20,40 @@ require ( github.com/sirupsen/logrus v1.7.0 github.com/urfave/cli v1.22.3 go.uber.org/zap v1.14.1 - golang.org/x/net v0.0.0-20200602114024-627f9648deb9 // indirect golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c + gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f +) + +require ( + github.com/Azure/go-ansiterm v0.0.0-20170929234023-d6e3b3328b78 // indirect + github.com/Microsoft/go-winio v0.5.0 // indirect + github.com/beorn7/perks v1.0.1 // indirect + github.com/cespare/xxhash/v2 v2.1.1 // indirect + github.com/containerd/containerd v1.3.4 // indirect + github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d // indirect + github.com/docker/distribution v2.7.1+incompatible // indirect + github.com/gogo/protobuf v1.1.1 // indirect + github.com/golang/protobuf v1.3.3 // indirect + github.com/gorilla/context v1.1.1 // indirect + github.com/gorilla/websocket v1.4.1 // indirect + github.com/kr/text v0.1.0 // indirect + github.com/matttproud/golang_protobuf_extensions v1.0.1 // indirect + github.com/morikuni/aec v1.0.0 // indirect + github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e // indirect + github.com/opencontainers/go-digest v1.0.0 // indirect + github.com/opencontainers/image-spec v1.0.1 // indirect + github.com/pkg/errors v0.9.1 // indirect + github.com/prometheus/client_model v0.2.0 // indirect + github.com/prometheus/common v0.9.1 // indirect + github.com/prometheus/procfs v0.0.8 // indirect + github.com/russross/blackfriday/v2 v2.0.1 // indirect + github.com/shurcooL/sanitized_anchor_name v1.0.0 // indirect + go.uber.org/atomic v1.6.0 // indirect + go.uber.org/multierr v1.5.0 // indirect + golang.org/x/net v0.0.0-20200602114024-627f9648deb9 // indirect golang.org/x/time v0.0.0-20201208040808-7e3f01d25324 // indirect + google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55 // indirect google.golang.org/grpc v1.29.1 // indirect - gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f gopkg.in/natefinch/lumberjack.v2 v2.0.0 // indirect gotest.tools v2.2.0+incompatible // indirect ) diff --git a/go.sum b/go.sum index c1f780c5..7fbd8ea2 100644 --- a/go.sum +++ b/go.sum @@ -2,8 +2,6 @@ cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMT github.com/Azure/go-ansiterm v0.0.0-20170929234023-d6e3b3328b78 h1:w+iIsaOQNcT7OZ575w+acHgRric5iCyQh+xv+KJ4HB8= github.com/Azure/go-ansiterm v0.0.0-20170929234023-d6e3b3328b78/go.mod h1:LmzpDX56iTiv29bbRTIsUNlaFfuhWRQBWjQdVyAevI8= github.com/BurntSushi/toml v0.3.1 h1:WXkYYl6Yr3qBf1K79EBnL4mak0OimBfB0XUf9Vl28OQ= -github.com/BurntSushi/toml v0.3.1 h1:WXkYYl6Yr3qBf1K79EBnL4mak0OimBfB0XUf9Vl28OQ= -github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= github.com/Microsoft/go-winio v0.5.0 h1:Elr9Wn+sGKPlkaBvwu4mTrxtmOp3F3yV9qhaHbXGjwU= github.com/Microsoft/go-winio v0.5.0/go.mod h1:JPGBdM1cNvN/6ISo+n8V5iA4v8pBzdOpzfwIujj1a84= @@ -28,7 +26,6 @@ github.com/coreos/etcd v3.3.10+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc github.com/coreos/go-etcd v2.0.0+incompatible/go.mod h1:Jez6KQU2B/sWsbdaef3ED8NzMklzPG4d5KIOhIy30Tk= github.com/coreos/go-semver v0.2.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= github.com/coreos/go-systemd v0.0.0-20190321100706-95778dfbb74e/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= -github.com/cpuguy83/go-md2man v1.0.10 h1:BSKMNlYxDvnunlTymqtgONjNnaRV1sTpcovwwjF22jk= github.com/cpuguy83/go-md2man v1.0.10/go.mod h1:SmD6nW6nTyfqj6ABTjUi3V3JVMnlJmwcJI5acqYI6dE= github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d h1:U+s90UTSYgptZMwQh2aRr3LuazLJIa+Pg3Kc1ylSYVY= github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU= @@ -145,7 +142,6 @@ github.com/rancher/go-fibmap v0.0.0-20160418233256-5fc9f8c1ed47/go.mod h1:aLaSmp github.com/rancher/go-rancher v0.1.1-0.20190307222549-9756097e5e4c h1:qOpIX3tKM+qjUXCiy52DOXm0EmeA6/SJeApK2tyKbVE= github.com/rancher/go-rancher v0.1.1-0.20190307222549-9756097e5e4c/go.mod h1:7oQvGNiJsGvrUgB+7AH8bmdzuR0uhULfwKb43Ht0hUk= github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= -github.com/russross/blackfriday v1.5.2 h1:HyvC0ARfnZBqnXwABFeSZHpKvJHJJfPz81GNueLj0oo= github.com/russross/blackfriday v1.5.2/go.mod h1:JO/DiYxRf+HjHt06OyowR9PTA263kcR/rfWxYHBV53g= github.com/russross/blackfriday/v2 v2.0.1 h1:lPqVAte+HuHNfhJ/0LC98ESWRz8afy9tM/0RK8m9o+Q= github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= @@ -235,7 +231,6 @@ golang.org/x/tools v0.0.0-20191029041327-9cc4af7d6b2c/go.mod h1:b+2E5dAYhXwXZwtn golang.org/x/tools v0.0.0-20191029190741-b9c20aec41a5 h1:hKsoRgsbwY1NafxrwTs+k64bikrLBkAgPir1TNCj3Zs= golang.org/x/tools v0.0.0-20191029190741-b9c20aec41a5/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543 h1:E7g+9GITq07hpfrRu66IVDexMakfv52eLZ2CXBWiKr4= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= diff --git a/replica/backup.go b/replica/backup.go index f2b5e81e..fd72de9d 100644 --- a/replica/backup.go +++ b/replica/backup.go @@ -231,7 +231,7 @@ func drainHoleCreatorChan() { } } -//CreateHoles removes the offsets from corresponding sparse files +// CreateHoles removes the offsets from corresponding sparse files func CreateHoles() { var ( fd uintptr diff --git a/replica/replica.go b/replica/replica.go index 2c1ec33c..c1949bea 100644 --- a/replica/replica.go +++ b/replica/replica.go @@ -691,8 +691,8 @@ func (r *Replica) DisplayChain() ([]string, error) { return result, nil } -//Chain returns the disk chain starting with Head(index=0), -//till the base snapshot +// Chain returns the disk chain starting with Head(index=0), +// till the base snapshot func (r *Replica) Chain() ([]string, error) { r.RLock() defer r.RUnlock() diff --git a/rpc/client.go b/rpc/client.go index fa845e11..dfced6f6 100644 --- a/rpc/client.go +++ b/rpc/client.go @@ -55,7 +55,7 @@ func SetRPCTimeout() { } } -//SampleOp operation +// SampleOp operation type SampleOp int const ( @@ -75,7 +75,7 @@ const ( OpUnmap ) -//Client replica client +// Client replica client type Client struct { end chan struct{} requests chan *Message @@ -89,7 +89,7 @@ type Client struct { err error } -//NewClient replica client +// NewClient replica client func NewClient(conn net.Conn, closeChan chan struct{}) *Client { c := &Client{ wire: NewWire(conn), @@ -107,12 +107,12 @@ func NewClient(conn net.Conn, closeChan chan struct{}) *Client { return c } -//TargetID operation target ID +// TargetID operation target ID func (c *Client) TargetID() string { return c.peerAddr } -//WriteAt replica client +// WriteAt replica client func (c *Client) WriteAt(buf []byte, offset int64) (int, error) { return c.operation(TypeWrite, buf, offset, int64(len(buf))) } @@ -124,19 +124,19 @@ func (c *Client) Update() (int, error) { } */ -//SetError replica client transport error +// SetError replica client transport error func (c *Client) SetError(err error) { c.responses <- &Message{ transportErr: err, } } -//ReadAt replica client +// ReadAt replica client func (c *Client) ReadAt(buf []byte, offset int64) (int, error) { return c.operation(TypeRead, buf, offset, int64(len(buf))) } -//Sync replica client +// Sync replica client func (c *Client) Sync() (int, error) { _, err := c.operation(TypeSync, nil, 0, 0) if err != nil { @@ -153,7 +153,7 @@ func (c *Client) Unmap(offset int64, length int64) (int, error) { return 0, err } -//Ping replica client +// Ping replica client func (c *Client) Ping() error { _, err := c.operation(TypePing, nil, 0, 0) return err @@ -244,7 +244,7 @@ func (c *Client) operation(op uint32, buf []byte, offset int64, length int64) (i } } -//Close replica client +// Close replica client func (c *Client) Close() error { if err := c.wire.CloseRead(); err != nil { return err