Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade dependencies #248

Merged
merged 8 commits into from
Feb 23, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 9 additions & 3 deletions .github/workflows/go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
go-version: [1.18.x, 1.19.x]
go-version: [1.19.x, 1.20.x]
os: [ubuntu-latest, macos-latest, windows-latest]
steps:
- name: Set up Go ${{ matrix.go-version }} on ${{ matrix.os }}
Expand All @@ -37,7 +37,7 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: 1.19.x
go-version: 1.20.x

- name: Checkout code
uses: actions/checkout@v2
Expand All @@ -50,5 +50,11 @@ jobs:

- name: Lint
run: |
curl -sSfL https://github.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v1.45.2
curl -sSfL https://github.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v1.51.2
$(go env GOPATH)/bin/golangci-lint run --timeout=5m --config ./.golangci.yml

- name: Staticcheck
uses: dominikh/staticcheck-action@v1.3.0
with:
version: "2023.1.2"
install-go: false
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
name: Set up Go
uses: actions/setup-go@v1
with:
go-version: 1.19.x
go-version: 1.20.x
-
name: Run GoReleaser
uses: goreleaser/goreleaser-action@53acad1befee355d46f71cccf6ab4d885eb4f77f
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/vulncheck.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
go-version: [ 1.19 ]
go-version: [ 1.20.x ]
steps:
- name: Check out code into the Go module directory
uses: actions/checkout@v3
Expand Down
5 changes: 2 additions & 3 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,8 @@ linters:
- revive
- ineffassign
- gosimple
- deadcode
- unused
- gofumpt
- structcheck

issues:
exclude-use-default: false
Expand All @@ -27,4 +26,4 @@ issues:
- should have comment or be unexported
- error strings should not be capitalized or end with punctuation or a newline
service:
golangci-lint-version: 1.45.2 # use the fixed version to not introduce new linters unexpectedly
golangci-lint-version: 1.51.2 # use the fixed version to not introduce new linters unexpectedly
8 changes: 5 additions & 3 deletions cli/benchclient.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,10 @@ import (
"sync"
"time"

"github.com/gorilla/websocket"
"github.com/minio/cli"
"github.com/minio/pkg/console"
"github.com/minio/warp/pkg/bench"
"github.com/minio/websocket"
)

// clientReplyType indicates the client reply type.
Expand Down Expand Up @@ -101,8 +101,10 @@ func (s serverRequest) executeBenchmark(ctx context.Context) (*clientBenchmark,
}

// Information on currently or last connected server.
var connectedMu sync.Mutex
var connected serverInfo
var (
connectedMu sync.Mutex
connected serverInfo
)

// wsUpgrader performs websocket upgrades.
var wsUpgrader = websocket.Upgrader{
Expand Down
20 changes: 11 additions & 9 deletions cli/benchmark.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ import (
"github.com/cheggaaa/pb"
"github.com/klauspost/compress/zstd"
"github.com/minio/cli"
"github.com/minio/madmin-go"
"github.com/minio/madmin-go/v2"
"github.com/minio/mc/pkg/probe"
"github.com/minio/pkg/console"
"github.com/minio/warp/api"
Expand Down Expand Up @@ -131,13 +131,14 @@ func runBench(ctx *cli.Context, b bench.Benchmark) error {
go func() {
defer close(pgDone)
defer pg.Finish()
tick := time.Tick(time.Millisecond * 125)
tick := time.NewTicker(time.Millisecond * 125)
defer tick.Stop()
pg.Set(-1)
pg.SetCaption("Preparing: ")
newVal := int64(-1)
for {
select {
case <-tick:
case <-tick.C:
current := pg.Get()
if current != newVal {
pg.Set64(newVal)
Expand Down Expand Up @@ -211,11 +212,12 @@ func runBench(ctx *cli.Context, b bench.Benchmark) error {
defer close(pgDone)
defer pg.Finish()
pg.SetCaption("Benchmarking:")
tick := time.Tick(time.Millisecond * 125)
tick := time.NewTicker(time.Millisecond * 125)
defer tick.Stop()
done := ctx2.Done()
for {
select {
case t := <-tick:
case t := <-tick.C:
elapsed := t.Sub(tStart)
if elapsed < 0 {
continue
Expand Down Expand Up @@ -354,10 +356,10 @@ type benchmarkStage string

const (
stagePrepare benchmarkStage = "prepare"
stageBenchmark = "benchmark"
stageCleanup = "cleanup"
stageDone = "done"
stageNotStarted = ""
stageBenchmark benchmarkStage = "benchmark"
stageCleanup benchmarkStage = "cleanup"
stageDone benchmarkStage = "done"
stageNotStarted benchmarkStage = ""
)

var benchmarkStages = []benchmarkStage{
Expand Down
36 changes: 17 additions & 19 deletions cli/benchserver.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,12 @@ import (
"sync"
"time"

"github.com/gorilla/websocket"
"github.com/klauspost/compress/zstd"
"github.com/minio/cli"
"github.com/minio/mc/pkg/probe"
"github.com/minio/warp/api"
"github.com/minio/warp/pkg/bench"
"github.com/minio/websocket"
)

const warpServerVersion = 1
Expand All @@ -42,10 +42,10 @@ type serverRequestOp string

const (
serverReqDisconnect serverRequestOp = "disconnect"
serverReqBenchmark = "benchmark"
serverReqStartStage = "start_stage"
serverReqStageStatus = "stage_status"
serverReqSendOps = "send_ops"
serverReqBenchmark serverRequestOp = "benchmark"
serverReqStartStage serverRequestOp = "start_stage"
serverReqStageStatus serverRequestOp = "stage_status"
serverReqSendOps serverRequestOp = "send_ops"
)

const serverFlagName = "serve"
Expand Down Expand Up @@ -444,22 +444,20 @@ func (c *connections) downloadOps() []bench.Operations {
wg.Add(1)
go func(i int) {
defer wg.Done()
for {
resp, err := c.roundTrip(i, serverRequest{Operation: serverReqSendOps})
if err != nil {
return
}
if resp.Err != "" {
c.errorF("Client %v returned error: %v\n", c.hostName(i), resp.Err)
return
}
c.info("Client ", c.hostName(i), ": Operations downloaded.")

mu.Lock()
res = append(res, resp.Ops)
mu.Unlock()
resp, err := c.roundTrip(i, serverRequest{Operation: serverReqSendOps})
if err != nil {
c.errorF("Client %v download returned error: %v\n", c.hostName(i), resp.Err)
return
}
if resp.Err != "" {
c.errorF("Client %v returned error: %v\n", c.hostName(i), resp.Err)
return
}
c.info("Client ", c.hostName(i), ": Operations downloaded.")

mu.Lock()
res = append(res, resp.Ops)
mu.Unlock()
}(i)
}
wg.Wait()
Expand Down
6 changes: 1 addition & 5 deletions cli/cli.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,6 @@ var (
globalJSON = false // Json flag set via command line
globalDebug = false // Debug flag set via command line
globalNoColor = false // No Color flag set via command line
// Terminal width
globalTermWidth int
)

const (
Expand Down Expand Up @@ -72,10 +70,8 @@ func Main(args []string) {

// Fetch terminal size, if not available, automatically
// set globalQuiet to true.
if w, e := pb.GetTerminalWidth(); e != nil {
if _, e := pb.GetTerminalWidth(); e != nil {
globalQuiet = true
} else {
globalTermWidth = w
}

// Set the warp app name.
Expand Down
6 changes: 2 additions & 4 deletions cli/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ import (
"time"

"github.com/minio/cli"
"github.com/minio/madmin-go"
"github.com/minio/madmin-go/v2"
"github.com/minio/mc/pkg/probe"
md5simd "github.com/minio/md5-simd"
"github.com/minio/minio-go/v7"
Expand Down Expand Up @@ -99,9 +99,7 @@ func newClient(ctx *cli.Context) func() (cl *minio.Client, done func()) {
now := time.Now()
off := rand.New(rand.NewSource(time.Now().UnixNano())).Intn(len(hosts))
for i := range lastFinished {
t := now
t.Add(time.Duration(i + off%len(hosts)))
lastFinished[i] = t
lastFinished[i] = now.Add(time.Duration(i + off%len(hosts)))
}
}
find := func() int {
Expand Down
60 changes: 30 additions & 30 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -5,59 +5,59 @@ go 1.18
require (
github.com/bygui86/multi-profile/v2 v2.1.0
github.com/cheggaaa/pb v1.0.29
github.com/dustin/go-humanize v1.0.0
github.com/fatih/color v1.13.0
github.com/gorilla/websocket v1.5.0
github.com/klauspost/compress v1.15.12
github.com/minio/cli v1.22.0
github.com/minio/madmin-go v1.7.5
github.com/minio/mc v0.0.0-20220628120902-bf1145af1e48
github.com/dustin/go-humanize v1.0.1
github.com/fatih/color v1.14.1
github.com/klauspost/compress v1.15.15
github.com/minio/cli v1.24.2
github.com/minio/madmin-go/v2 v2.0.14
github.com/minio/mc v0.0.0-20230221173238-1843bab50013
github.com/minio/md5-simd v1.1.2
github.com/minio/minio-go/v7 v7.0.47
github.com/minio/pkg v1.1.26
github.com/minio/minio-go/v7 v7.0.49
github.com/minio/pkg v1.6.3
github.com/minio/websocket v1.6.0
github.com/posener/complete v1.2.3
github.com/secure-io/sio-go v0.3.1
golang.org/x/net v0.0.0-20221017152216-f25eb7ecb193
golang.org/x/net v0.7.0
)

require (
github.com/decred/dcrd/dcrec/secp256k1/v4 v4.0.1 // indirect
github.com/decred/dcrd/dcrec/secp256k1/v4 v4.1.0 // indirect
github.com/go-ole/go-ole v1.2.6 // indirect
github.com/goccy/go-json v0.9.8 // indirect
github.com/goccy/go-json v0.10.0 // indirect
github.com/google/uuid v1.3.0 // indirect
github.com/hashicorp/errwrap v1.1.0 // indirect
github.com/hashicorp/go-multierror v1.1.1 // indirect
github.com/json-iterator/go v1.1.12 // indirect
github.com/klauspost/cpuid/v2 v2.1.0 // indirect
github.com/klauspost/cpuid/v2 v2.2.4 // indirect
github.com/lestrrat-go/backoff/v2 v2.0.8 // indirect
github.com/lestrrat-go/blackmagic v1.0.1 // indirect
github.com/lestrrat-go/httpcc v1.0.1 // indirect
github.com/lestrrat-go/iter v1.0.2 // indirect
github.com/lestrrat-go/jwx v1.2.25 // indirect
github.com/lestrrat-go/option v1.0.0 // indirect
github.com/lufia/plan9stats v0.0.0-20220913051719-115f729f3c8c // indirect
github.com/mattn/go-colorable v0.1.12 // indirect
github.com/mattn/go-isatty v0.0.14 // indirect
github.com/mattn/go-runewidth v0.0.13 // indirect
github.com/lestrrat-go/option v1.0.1 // indirect
github.com/lufia/plan9stats v0.0.0-20230110061619-bbe2e5e100de // indirect
github.com/mattn/go-colorable v0.1.13 // indirect
github.com/mattn/go-isatty v0.0.17 // indirect
github.com/mattn/go-runewidth v0.0.14 // indirect
github.com/minio/sha256-simd v1.0.0 // indirect
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
github.com/modern-go/reflect2 v1.0.2 // indirect
github.com/philhofer/fwd v1.1.1 // indirect
github.com/philhofer/fwd v1.1.2 // indirect
github.com/pkg/errors v0.9.1 // indirect
github.com/power-devops/perfstat v0.0.0-20220216144756-c35f1ee13d7c // indirect
github.com/prometheus/procfs v0.8.0 // indirect
github.com/rivo/uniseg v0.2.0 // indirect
github.com/rjeczalik/notify v0.9.2 // indirect
github.com/power-devops/perfstat v0.0.0-20221212215047-62379fc7944b // indirect
github.com/prometheus/procfs v0.9.0 // indirect
github.com/rivo/uniseg v0.4.4 // indirect
github.com/rjeczalik/notify v0.9.3 // indirect
github.com/rs/xid v1.4.0 // indirect
github.com/shirou/gopsutil/v3 v3.22.9 // indirect
github.com/shirou/gopsutil/v3 v3.23.1 // indirect
github.com/sirupsen/logrus v1.9.0 // indirect
github.com/tinylib/msgp v1.1.6 // indirect
github.com/tklauser/go-sysconf v0.3.10 // indirect
github.com/tklauser/numcpus v0.5.0 // indirect
github.com/tinylib/msgp v1.1.8 // indirect
github.com/tklauser/go-sysconf v0.3.11 // indirect
github.com/tklauser/numcpus v0.6.0 // indirect
github.com/yusufpapurcu/wmi v1.2.2 // indirect
golang.org/x/crypto v0.0.0-20221012134737-56aed061732a // indirect
golang.org/x/crypto v0.6.0 // indirect
golang.org/x/sync v0.1.0 // indirect
golang.org/x/sys v0.1.0 // indirect
golang.org/x/text v0.3.7 // indirect
golang.org/x/sys v0.5.0 // indirect
golang.org/x/text v0.7.0 // indirect
gopkg.in/ini.v1 v1.67.0 // indirect
)
Loading