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

Bump Go versions #303

Merged
merged 3 commits into from
Mar 8, 2024
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
4 changes: 2 additions & 2 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.20.x, 1.21.x]
go-version: [1.21.x, 1.22.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.21.x
go-version: 1.22.x

- name: Checkout code
uses: actions/checkout@v2
Expand Down
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.21.x
go-version: 1.22.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.21.5 ]
go-version: [ 1.22.x ]
steps:
- name: Check out code into the Go module directory
uses: actions/checkout@v3
Expand Down
2 changes: 1 addition & 1 deletion api/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ func (s *Server) handleAggregated(w http.ResponseWriter, req *http.Request) {
w.Write([]byte(err.Error()))
return
}
durFn := func(total time.Duration) time.Duration {
durFn := func(time.Duration) time.Duration {
return segmentDur
}
harshavardhana marked this conversation as resolved.
Show resolved Hide resolved
s.mu.Lock()
Expand Down
2 changes: 1 addition & 1 deletion cli/benchclient.go
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ var (

// wsUpgrader performs websocket upgrades.
var wsUpgrader = websocket.Upgrader{
CheckOrigin: func(r *http.Request) bool {
CheckOrigin: func(_ *http.Request) bool {
return true
},
}
Expand Down
2 changes: 1 addition & 1 deletion cli/cli.go
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ func registerApp(name string, appCmds []cli.Command) *cli.App {
return nil
}

afterExec = func(ctx *cli.Context) error {
afterExec = func(_ *cli.Context) error {
for _, profile := range profiles {
profile.Stop()
}
Expand Down
4 changes: 2 additions & 2 deletions cli/influx.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,8 @@ func newInfluxDB(ctx *cli.Context, wg *sync.WaitGroup) chan<- bench.Operation {
// Use blocking write client for writes to desired bucket
path := strings.Split(strings.TrimPrefix(u.Path, "/"), "/")
writeAPI := client.WriteAPI(path[1], path[0])
writeAPI.SetWriteFailedCallback(func(batch string, error http.Error, retryAttempts uint) bool {
errorIf(probe.NewError(err), "unable to write to influxdb")
writeAPI.SetWriteFailedCallback(func(_ string, err http.Error, _ uint) bool {
errorIf(probe.NewError(&err), "unable to write to influxdb")
return false
})
ch := make(chan bench.Operation, 10000)
Expand Down
4 changes: 2 additions & 2 deletions pkg/bench/mixed.go
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ func (g *Mixed) Prepare(ctx context.Context) error {
var groupErr error
var mu sync.Mutex
for i := 0; i < g.Concurrency; i++ {
go func(i int) {
go func() {
defer wg.Done()
src := g.Source()

Expand Down Expand Up @@ -218,7 +218,7 @@ func (g *Mixed) Prepare(ctx context.Context) error {
g.Dist.addObj(*obj)
g.prepareProgress(float64(len(g.Dist.objects)) / float64(g.CreateObjects))
}
}(i)
}()
}
wg.Wait()
return groupErr
Expand Down
9 changes: 4 additions & 5 deletions pkg/bench/versioned.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ import (
"io"
"math/rand"
"net/http"
"sort"
"sync"
"time"

Expand Down Expand Up @@ -75,7 +74,7 @@ func (g *Versioned) Prepare(ctx context.Context) error {
var groupErr error
var mu sync.Mutex
for i := 0; i < g.Concurrency; i++ {
go func(i int) {
go func() {
defer wg.Done()
src := g.Source()

Expand Down Expand Up @@ -123,7 +122,7 @@ func (g *Versioned) Prepare(ctx context.Context) error {
g.Dist.addObj(*obj)
g.prepareProgress(float64(len(g.Dist.objects)) / float64(g.CreateObjects))
}
}(i)
}()
}
wg.Wait()
return groupErr
Expand Down Expand Up @@ -339,8 +338,8 @@ func (m *VersionedDistribution) Generate(allocObjs int) error {
}
}
m.rng = rand.New(rand.NewSource(0xabad1dea))
sort.Slice(m.ops, func(i, j int) bool {
return m.rng.Int63()&1 == 0
m.rng.Shuffle(len(m.ops), func(i, j int) {
m.ops[i], m.ops[j] = m.ops[j], m.ops[i]
})
return nil
}
Expand Down
Loading