Skip to content

Commit

Permalink
linter checks
Browse files Browse the repository at this point in the history
  • Loading branch information
nikandfor committed Jan 7, 2024
1 parent 86540c5 commit 164052e
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 9 deletions.
2 changes: 0 additions & 2 deletions batch4.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,6 @@ type (
}
)

const usage = "QueueIn -> Enter -> defer Exit -> Commit/Cancel"

var Canceled = errors.New("batch canceled")

func New[Res any](f func(ctx context.Context) (Res, error)) *Coordinator[Res] {
Expand Down
4 changes: 2 additions & 2 deletions batch4_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ func TestCoordinatorAllCases(tb *testing.T) {
func() {
if i == 3 && j == 1 {
defer func() {
recover()
_ = recover()
}()
}

Expand Down Expand Up @@ -152,7 +152,7 @@ func TestCoordinatorAllCases(tb *testing.T) {

res, err := bc.Commit(ctx, false)
if err != nil {
//
_ = err
}

if pe, ok := batch.AsPanicError(err); ok {
Expand Down
4 changes: 1 addition & 3 deletions examples_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ func (s *Service) commit(ctx context.Context) (int, error) {
func (s *Service) DoWork(ctx context.Context, data int) (int, error) {
s.bc.QueueIn() // let others know we are going to join

data = data // prepare out data
_ = data // prepare data

idx := s.bc.Enter(true) // true for blocking, false if we want to leave instead of waiting
// if idx < 0 // we haven't entered the batch in non blocking mode
Expand Down Expand Up @@ -63,8 +63,6 @@ func (s *Service) DoWork(ctx context.Context, data int) (int, error) {
}

func ExampleCoordinator() {
const N = 10

s := NewService()

// let's spin up some workers
Expand Down
4 changes: 2 additions & 2 deletions multi_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ func TestMulti(tb *testing.T) {
func() {
if i == 3 && j == 1 {
defer func() {
recover()
_ = recover()
}()
}

Expand Down Expand Up @@ -79,7 +79,7 @@ func TestMulti(tb *testing.T) {

res, err := bc.Commit(ctx, coach, false)
if err != nil {
//
_ = err
}

if pe, ok := batch.AsPanicError(err); ok {
Expand Down

0 comments on commit 164052e

Please sign in to comment.