MCPcopy
hub / github.com/gin-gonic/gin / WriteHeader

Method WriteHeader

response_writer.go:67–75  ·  view source on GitHub ↗
(code int)

Source from the content-addressed store, hash-verified

65}
66
67func (w *responseWriter) WriteHeader(code int) {
68 if code > 0 && w.status != code {
69 if w.Written() {
70 debugPrint("[WARNING] Headers were already written. Wanted to override status code %d with %d", w.status, code)
71 return
72 }
73 w.status = code
74 }
75}
76
77func (w *responseWriter) WriteHeaderNow() {
78 if !w.Written() {

Callers 2

TestResponseWriterFlushFunction · 0.95
WriteHeaderNowMethod · 0.45

Calls 2

WrittenMethod · 0.95
debugPrintFunction · 0.85

Tested by 1

TestResponseWriterFlushFunction · 0.76