Home / Function/ Benchmark_FormBinder_Bind() — fiber Function Reference

Benchmark_FormBinder_Bind() — fiber Function Reference

Architecture documentation for the Benchmark_FormBinder_Bind() function in form_test.go from the fiber codebase.

Entity Profile

Dependency Diagram

graph TD
  b6d0ad6a_283e_cec9_35cc_56e6355f5410["Benchmark_FormBinder_Bind()"]
  9e2874af_daa9_2d85_5c35_752d6b7678f6["form_test.go"]
  b6d0ad6a_283e_cec9_35cc_56e6355f5410 -->|defined in| 9e2874af_daa9_2d85_5c35_752d6b7678f6
  style b6d0ad6a_283e_cec9_35cc_56e6355f5410 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

binder/form_test.go lines 71–98

func Benchmark_FormBinder_Bind(b *testing.B) {
	b.ReportAllocs()

	binder := &FormBinding{
		EnableSplitting: true,
	}

	type User struct {
		Name  string   `form:"name"`
		Posts []string `form:"posts"`
		Age   int      `form:"age"`
	}
	var user User

	req := fasthttp.AcquireRequest()
	req.SetBodyString("name=john&age=42&posts=post1,post2,post3")
	req.Header.SetContentType("application/x-www-form-urlencoded")

	var err error
	for b.Loop() {
		err = binder.Bind(req, &user)
	}

	require.NoError(b, err)
	require.Equal(b, "john", user.Name)
	require.Equal(b, 42, user.Age)
	require.Len(b, user.Posts, 3)
}

Domain

Subdomains

Defined In

Frequently Asked Questions

What does Benchmark_FormBinder_Bind() do?
Benchmark_FormBinder_Bind() is a function in the fiber codebase, defined in binder/form_test.go.
Where is Benchmark_FormBinder_Bind() defined?
Benchmark_FormBinder_Bind() is defined in binder/form_test.go at line 71.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free