MCPcopy Index your code
hub / github.com/imroc/req / writeDebug

Method writeDebug

internal/http2/frame.go:188–213  ·  view source on GitHub ↗
(buf *bytes.Buffer)

Source from the content-addressed store, hash-verified

186}
187
188func (h FrameHeader) writeDebug(buf *bytes.Buffer) {
189 buf.WriteString(h.Type.String())
190 if h.Flags != 0 {
191 buf.WriteString(" flags=")
192 set := 0
193 for i := uint8(0); i < 8; i++ {
194 if h.Flags&(1<<i) == 0 {
195 continue
196 }
197 set++
198 if set > 1 {
199 buf.WriteByte('|')
200 }
201 name := flagName[h.Type][Flags(1<<i)]
202 if name != "" {
203 buf.WriteString(name)
204 } else {
205 fmt.Fprintf(buf, "0x%x", 1<<i)
206 }
207 }
208 }
209 if h.StreamID != 0 {
210 fmt.Fprintf(buf, " stream=%d", h.StreamID)
211 }
212 fmt.Fprintf(buf, " len=%d", h.Length)
213}
214
215func (h *FrameHeader) checkValid() {
216 if !h.valid {

Callers 2

StringMethod · 0.95
summarizeFrameFunction · 0.80

Calls 3

FlagsTypeAlias · 0.85
WriteStringMethod · 0.80
StringMethod · 0.45

Tested by

no test coverage detected