Home / Function/ Test_Extractor_Chain_NilFunctions() — fiber Function Reference

Test_Extractor_Chain_NilFunctions() — fiber Function Reference

Architecture documentation for the Test_Extractor_Chain_NilFunctions() function in extractors_test.go from the fiber codebase.

Entity Profile

Dependency Diagram

graph TD
  c5390632_617c_3203_80ee_48914b41cd57["Test_Extractor_Chain_NilFunctions()"]
  cf5e296e_8db5_6f84_b05a_9c0cac6f83e7["extractors_test.go"]
  c5390632_617c_3203_80ee_48914b41cd57 -->|defined in| cf5e296e_8db5_6f84_b05a_9c0cac6f83e7
  style c5390632_617c_3203_80ee_48914b41cd57 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

extractors/extractors_test.go lines 678–706

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

	app := fiber.New()

	// Test chain with nil extractor functions
	nilExtractor := Extractor{
		Extract: nil,
		Key:     "nil",
		Source:  SourceCustom,
	}

	validExtractor := Extractor{
		Extract: func(_ fiber.Ctx) (string, error) {
			return "valid-token", nil
		},
		Key:    "valid",
		Source: SourceCustom,
	}

	chainExtractor := Chain(nilExtractor, validExtractor)

	ctx := app.AcquireCtx(&fasthttp.RequestCtx{})
	t.Cleanup(func() { app.ReleaseCtx(ctx) })

	token, err := chainExtractor.Extract(ctx)
	require.NoError(t, err)
	require.Equal(t, "valid-token", token)
}

Domain

Subdomains

Frequently Asked Questions

What does Test_Extractor_Chain_NilFunctions() do?
Test_Extractor_Chain_NilFunctions() is a function in the fiber codebase, defined in extractors/extractors_test.go.
Where is Test_Extractor_Chain_NilFunctions() defined?
Test_Extractor_Chain_NilFunctions() is defined in extractors/extractors_test.go at line 678.

Analyze Your Own Codebase

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

Try Supermodel Free