Home / Function/ Test_QueryBinder_Bind_PointerSlices() — fiber Function Reference

Test_QueryBinder_Bind_PointerSlices() — fiber Function Reference

Architecture documentation for the Test_QueryBinder_Bind_PointerSlices() function in query_test.go from the fiber codebase.

Entity Profile

Dependency Diagram

graph TD
  e46cc77f_0635_bf79_dbb7_20e4cacb92ca["Test_QueryBinder_Bind_PointerSlices()"]
  ec649929_2505_8592_7c6d_a7dfe7415aef["query_test.go"]
  e46cc77f_0635_bf79_dbb7_20e4cacb92ca -->|defined in| ec649929_2505_8592_7c6d_a7dfe7415aef
  style e46cc77f_0635_bf79_dbb7_20e4cacb92ca fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

binder/query_test.go lines 88–122

func Test_QueryBinder_Bind_PointerSlices(t *testing.T) {
	t.Parallel()

	binder := &QueryBinding{
		EnableSplitting: true,
	}

	type Preferences struct {
		Tags *[]string `query:"tags"`
	}

	type Profile struct {
		Emails *[]string    `query:"emails"`
		Prefs  *Preferences `query:"preferences"`
	}

	var profile Profile

	req := fasthttp.AcquireRequest()
	req.URI().SetQueryString("emails=work,personal&preferences[tags]=golang,api")

	t.Cleanup(func() {
		fasthttp.ReleaseRequest(req)
	})

	err := binder.Bind(req, &profile)
	require.NoError(t, err)

	require.NotNil(t, profile.Emails)
	require.ElementsMatch(t, []string{"work", "personal"}, *profile.Emails)

	require.NotNil(t, profile.Prefs)
	require.NotNil(t, profile.Prefs.Tags)
	require.ElementsMatch(t, []string{"golang", "api"}, *profile.Prefs.Tags)
}

Domain

Subdomains

Frequently Asked Questions

What does Test_QueryBinder_Bind_PointerSlices() do?
Test_QueryBinder_Bind_PointerSlices() is a function in the fiber codebase, defined in binder/query_test.go.
Where is Test_QueryBinder_Bind_PointerSlices() defined?
Test_QueryBinder_Bind_PointerSlices() is defined in binder/query_test.go at line 88.

Analyze Your Own Codebase

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

Try Supermodel Free