Skip to content

Commit

Permalink
Remove fmt dependency from the flowcontrol package
Browse files Browse the repository at this point in the history
  • Loading branch information
zenhack committed Feb 19, 2023
1 parent e4d46e9 commit 348bcf9
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions flowcontrol/fixed.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ package flowcontrol

import (
"context"
"fmt"

"capnproto.org/go/capnp/v3/internal/str"
"golang.org/x/sync/semaphore"
)

Expand All @@ -26,7 +26,9 @@ func (fl *fixedLimiter) StartMessage(ctx context.Context, size uint64) (gotRespo
// reservation on the semaphore. We can't return an error because it
// is currently ignored by the caller.
if int64(size) > fl.size {
panic(fmt.Sprintf("StartMessage(): message size %d is too large (max %d)", size, fl.size))
panic("StartMessage(): message size " +
str.Utod(size) +
" is too large (max " + str.Itod(fl.size) + ")")
}

if err = fl.sem.Acquire(ctx, int64(size)); err == nil {
Expand Down

0 comments on commit 348bcf9

Please sign in to comment.