Home / Function/ Test_SetParserDecoder_CustomConverter() — fiber Function Reference

Test_SetParserDecoder_CustomConverter() — fiber Function Reference

Architecture documentation for the Test_SetParserDecoder_CustomConverter() function in binder_test.go from the fiber codebase.

Entity Profile

Dependency Diagram

graph TD
  d6b8ae72_3870_a95a_f16e_685df1c727f7["Test_SetParserDecoder_CustomConverter()"]
  85091b00_b20b_efcc_56f1_31b94278fe54["binder_test.go"]
  d6b8ae72_3870_a95a_f16e_685df1c727f7 -->|defined in| 85091b00_b20b_efcc_56f1_31b94278fe54
  style d6b8ae72_3870_a95a_f16e_685df1c727f7 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

binder/binder_test.go lines 126–144

func Test_SetParserDecoder_CustomConverter(t *testing.T) {
	type myInt int
	conv := func(s string) reflect.Value {
		v, _ := strconv.Atoi(s) //nolint:errcheck // not needed
		mi := myInt(v)
		return reflect.ValueOf(mi)
	}

	SetParserDecoder(ParserConfig{ParserType: []ParserType{{CustomType: myInt(0), Converter: conv}}})
	defer SetParserDecoder(ParserConfig{IgnoreUnknownKeys: true, ZeroEmpty: true})

	type data struct {
		V myInt `query:"v"`
	}
	d := new(data)
	err := parse("query", d, map[string][]string{"v": {"5"}})
	require.NoError(t, err)
	require.Equal(t, myInt(5), d.V)
}

Domain

Subdomains

Frequently Asked Questions

What does Test_SetParserDecoder_CustomConverter() do?
Test_SetParserDecoder_CustomConverter() is a function in the fiber codebase, defined in binder/binder_test.go.
Where is Test_SetParserDecoder_CustomConverter() defined?
Test_SetParserDecoder_CustomConverter() is defined in binder/binder_test.go at line 126.

Analyze Your Own Codebase

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

Try Supermodel Free