Benchmark_Utils_SortAcceptedTypes_Unsorted() — fiber Function Reference
Architecture documentation for the Benchmark_Utils_SortAcceptedTypes_Unsorted() function in helpers_test.go from the fiber codebase.
Entity Profile
Dependency Diagram
graph TD 04859fd7_56b9_baed_9967_2c44d252392a["Benchmark_Utils_SortAcceptedTypes_Unsorted()"] c82e3595_b1b8_f596_c097_f26fa40159d1["helpers_test.go"] 04859fd7_56b9_baed_9967_2c44d252392a -->|defined in| c82e3595_b1b8_f596_c097_f26fa40159d1 style 04859fd7_56b9_baed_9967_2c44d252392a fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
helpers_test.go lines 585–615
func Benchmark_Utils_SortAcceptedTypes_Unsorted(b *testing.B) {
acceptedTypes := make([]acceptedType, 11)
b.ReportAllocs()
for b.Loop() {
acceptedTypes[0] = acceptedType{spec: "text/html", quality: 1, specificity: 3, order: 0}
acceptedTypes[1] = acceptedType{spec: "text/*", quality: 0.5, specificity: 2, order: 1}
acceptedTypes[2] = acceptedType{spec: "*/*", quality: 0.1, specificity: 1, order: 2}
acceptedTypes[3] = acceptedType{spec: "application/json", quality: 0.999, specificity: 3, order: 3}
acceptedTypes[4] = acceptedType{spec: "application/xml", quality: 1, specificity: 3, order: 4}
acceptedTypes[5] = acceptedType{spec: "application/pdf", quality: 1, specificity: 3, order: 5}
acceptedTypes[6] = acceptedType{spec: "image/png", quality: 1, specificity: 3, order: 6}
acceptedTypes[7] = acceptedType{spec: "image/jpeg", quality: 1, specificity: 3, order: 7}
acceptedTypes[8] = acceptedType{spec: "image/*", quality: 1, specificity: 2, order: 8}
acceptedTypes[9] = acceptedType{spec: "image/gif", quality: 1, specificity: 3, order: 9}
acceptedTypes[10] = acceptedType{spec: "text/plain", quality: 1, specificity: 3, order: 10}
sortAcceptedTypes(acceptedTypes)
}
require.Equal(b, []acceptedType{
{spec: "text/html", quality: 1, specificity: 3, order: 0},
{spec: "application/xml", quality: 1, specificity: 3, order: 4},
{spec: "application/pdf", quality: 1, specificity: 3, order: 5},
{spec: "image/png", quality: 1, specificity: 3, order: 6},
{spec: "image/jpeg", quality: 1, specificity: 3, order: 7},
{spec: "image/gif", quality: 1, specificity: 3, order: 9},
{spec: "text/plain", quality: 1, specificity: 3, order: 10},
{spec: "image/*", quality: 1, specificity: 2, order: 8},
{spec: "application/json", quality: 0.999, specificity: 3, order: 3},
{spec: "text/*", quality: 0.5, specificity: 2, order: 1},
{spec: "*/*", quality: 0.1, specificity: 1, order: 2},
}, acceptedTypes)
}
Domain
Subdomains
Defined In
Source
Frequently Asked Questions
What does Benchmark_Utils_SortAcceptedTypes_Unsorted() do?
Benchmark_Utils_SortAcceptedTypes_Unsorted() is a function in the fiber codebase, defined in helpers_test.go.
Where is Benchmark_Utils_SortAcceptedTypes_Unsorted() defined?
Benchmark_Utils_SortAcceptedTypes_Unsorted() is defined in helpers_test.go at line 585.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free