Skip to content
Open
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
2 changes: 1 addition & 1 deletion bind.go
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ func bindMetaFor(typ reflect.Type) *bindStructMeta {
}
n := typ.NumField()
meta := &bindStructMeta{fields: make([]bindFieldMeta, n)}
for i := 0; i < n; i++ {
for i := range n {
f := typ.Field(i)
meta.fields[i] = bindFieldMeta{
index: i,
Expand Down
6 changes: 3 additions & 3 deletions json_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ func TestDefaultJSONCodec_Decode_RejectsTrailingData(t *testing.T) {
// followed by a short one must each decode to exactly their own input.
func TestDefaultJSONCodec_Decode_PooledBufferReuse(t *testing.T) {
e := New()
for i := 0; i < 50; i++ {
for i := range 50 {
longName := strings.Repeat("x", 1000+i)
var long user
err := deserializeJSON(e, fmt.Sprintf(`{"id":%d,"name":%q}`, i, longName), &long)
Expand All @@ -159,7 +159,7 @@ func TestDefaultJSONCodec_Decode_PooledBufferConcurrent(t *testing.T) {
var wg sync.WaitGroup
errs := make([]error, n)
got := make([]user, n)
for i := 0; i < n; i++ {
for i := range n {
wg.Add(1)
go func(i int) {
defer wg.Done()
Expand All @@ -168,7 +168,7 @@ func TestDefaultJSONCodec_Decode_PooledBufferConcurrent(t *testing.T) {
}(i)
}
wg.Wait()
for i := 0; i < n; i++ {
for i := range n {
assert.NoError(t, errs[i])
assert.Equal(t, user{ID: i, Name: strings.Repeat("n", i+1)}, got[i])
}
Expand Down
2 changes: 1 addition & 1 deletion perf_bench_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ func BenchmarkServeHTTP_Param(b *testing.B) {
// Exercises the global middleware chain (finding #1). Five pass-through middlewares.
func BenchmarkServeHTTP_Middleware(b *testing.B) {
e := New()
for i := 0; i < 5; i++ {
for range 5 {
e.Use(func(next HandlerFunc) HandlerFunc {
return func(c *Context) error { return next(c) }
})
Expand Down
Loading