Skip to content

Commit

Permalink
linting changes
Browse files Browse the repository at this point in the history
Signed-off-by: Yash Sharma <yashrsharma44@gmail.com>
  • Loading branch information
yashrsharma44 committed Jan 30, 2021
1 parent 45d5eb0 commit 27dddb0
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
11 changes: 6 additions & 5 deletions interceptors/retry/examples_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,10 @@ import (
"google.golang.org/grpc"
"google.golang.org/grpc/codes"

"github.com/stretchr/testify/assert"

"github.com/grpc-ecosystem/go-grpc-middleware/v2/interceptors/retry"
"github.com/grpc-ecosystem/go-grpc-middleware/v2/testing/testpb"
"github.com/stretchr/testify/assert"
)

var cc *grpc.ClientConn
Expand Down Expand Up @@ -91,17 +92,17 @@ func ExampleWithPerRetryTimeout() {
retry.WithPerRetryTimeout(1*time.Second))
}

// scale duration by a factor
// scale duration by a factor.
func scaleDuration(d time.Duration, factor float64) time.Duration {
return time.Duration(float64(d) * factor)
}

func TestJitterUp(t *testing.T) {
// arguments to jitterup
// arguments to jitterup.
duration := 10 * time.Second
variance := 0.10

// bound to check
// bound to check.
max := 11000 * time.Millisecond
min := 9000 * time.Millisecond
high := scaleDuration(max, 0.98)
Expand All @@ -125,4 +126,4 @@ func TestJitterUp(t *testing.T) {

assert.True(t, highCount != 0, "at least one sample should reach to >%s", high)
assert.True(t, lowCount != 0, "at least one sample should to <%s", low)
}
}
3 changes: 2 additions & 1 deletion providers/tokenbucket/examples_test.go
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
package tokenbucket

import (
grpc_ratelimit "github.com/grpc-ecosystem/go-grpc-middleware/v2/interceptors/ratelimit"
"github.com/juju/ratelimit"
"google.golang.org/grpc"

grpc_ratelimit "github.com/grpc-ecosystem/go-grpc-middleware/v2/interceptors/ratelimit"
)

// Hard-coded for simplicity sake, but make this configurable in your application.
Expand Down

0 comments on commit 27dddb0

Please sign in to comment.