MCPcopy Create free account
hub / github.com/imroc/req / headerSorter

Struct headerSorter

header.go:30–32  ·  view source on GitHub ↗

A headerSorter implements sort.Interface by sorting a []keyValues by key. It's used as a pointer, so it can fit in a sort.Interface interface value without allocation.

Source from the content-addressed store, hash-verified

28// by key. It's used as a pointer, so it can fit in a sort.Interface
29// interface value without allocation.
30type headerSorter struct {
31 kvs []header.KeyValues
32}
33
34func (s *headerSorter) Len() int { return len(s.kvs) }
35func (s *headerSorter) Swap(i, j int) { s.kvs[i], s.kvs[j] = s.kvs[j], s.kvs[i] }

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected