Skip to content

Upgrade to go 1.23 #6

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

Merged
merged 1 commit into from
Jan 6, 2025
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/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
test:
strategy:
matrix:
go-version: [1.19.x, 1.20.x, 1.21.x]
go-version: [1.21.x, 1.22.x, 1.23.x]
os: [ubuntu-latest]
runs-on: ${{ matrix.os }}
steps:
Expand All @@ -21,6 +21,6 @@ jobs:
- name: golangci-lint
uses: golangci/golangci-lint-action@v3
with:
version: v1.55
version: v1.63
- run: go vet ./...
- run: go test -v -race ./...
2 changes: 2 additions & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,5 @@ linters:
- gofmt
- gocritic
- unconvert
- revive
- govet
2 changes: 1 addition & 1 deletion example_request_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ func makeRequests(ctx context.Context, requests []Request, window int) (results

pipeliner := pipeliner.NewPipeliner(window)

worker := func(ctx context.Context, i int) error {
worker := func(_ context.Context, i int) error {
res, err := requests[i].Do()
resultsLock.Lock()
results[i] = res
Expand Down
4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ module github.com/keybase/pipeliner
go 1.19

require (
github.com/stretchr/testify v1.8.4
golang.org/x/net v0.19.0
github.com/stretchr/testify v1.10.0
golang.org/x/net v0.34.0
)

require (
Expand Down
8 changes: 4 additions & 4 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ 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/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk=
github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo=
golang.org/x/net v0.19.0 h1:zTwKpTd2XuCqf8huc7Fo2iSy+4RHPd10s4KzeTnVr1c=
golang.org/x/net v0.19.0/go.mod h1:CfAk/cbD4CthTvqiEl8NpboMuiuOYsAr/7NOjZJtv1U=
github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA=
github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
golang.org/x/net v0.34.0 h1:Mb7Mrk043xzHgnRM88suvJFwzVrRfHEHJEl5/71CKw0=
golang.org/x/net v0.34.0/go.mod h1:di0qlW3YNM5oh6GqDGQr92MyTozJPmybPK4Ev/Gm31k=
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.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
Expand Down
4 changes: 2 additions & 2 deletions pipeliner.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
)

// Pipeliner coordinates a flow of parallel requests, rate-limiting so that
// only a fixed number are oustanding at any one given time.
// only a fixed number are outstanding at any one given time.
type Pipeliner struct {
sync.RWMutex
window int
Expand Down Expand Up @@ -46,7 +46,7 @@ func (p *Pipeliner) launchOne() {
// another request. It returns an error if any prior request failed,
// instructing the caller to stop firing off new requests. The error
// originates either from CompleteOne(), or from a context-based
// cancelation
// cancellation
func (p *Pipeliner) WaitForRoom(ctx context.Context) error {
for {
p.checkContextDone(ctx)
Expand Down
5 changes: 3 additions & 2 deletions pipeliner_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,12 @@ package pipeliner
import (
"context"
"errors"
"github.com/stretchr/testify/require"
"math/rand"
"sync"
"testing"
"time"

"github.com/stretchr/testify/require"
)

func TestPipeliner(t *testing.T) {
Expand Down Expand Up @@ -58,7 +59,7 @@ func testPipeliner(doError bool, doCancel bool) ([]int, error) {
ctx, cancelFunc = context.WithCancel(ctx)
}

f := func(ctx context.Context, i int) error {
f := func(_ context.Context, i int) error {
if doError && i == 20 {
return errors.New("errored out")
}
Expand Down
Loading