MCPcopy Index your code
hub / github.com/tailscale/tailscale / WriteString

Method WriteString

tempfork/httprec/httprec.go:113–119  ·  view source on GitHub ↗

WriteString implements [io.StringWriter]. The data in str is written to rw.Body, if not nil.

(str string)

Source from the content-addressed store, hash-verified

111// WriteString implements [io.StringWriter]. The data in str is written
112// to rw.Body, if not nil.
113func (rw *ResponseRecorder) WriteString(str string) (int, error) {
114 rw.writeHeader(nil, str)
115 if rw.Body != nil {
116 rw.Body.WriteString(str)
117 }
118 return len(str), nil
119}
120
121func checkWriteHeaderCode(code int) {
122 // Issue 22880: require valid WriteHeader status codes.

Callers 15

TestConnFunction · 0.80
TestLoopbackSOCKS5Function · 0.80
TestUDPConnFunction · 0.80
promMetricLabelsStrFunction · 0.80
TestSelfDialFunction · 0.80
ServeHTTPMethod · 0.80
installSystemdFunction · 0.80
mainFunction · 0.80
serveTailscaleUpMethod · 0.80
QuoteFunction · 0.80
testControlHTTPFunction · 0.80

Calls 1

writeHeaderMethod · 0.95

Tested by 15

TestConnFunction · 0.64
TestLoopbackSOCKS5Function · 0.64
TestUDPConnFunction · 0.64
promMetricLabelsStrFunction · 0.64
TestSelfDialFunction · 0.64
testControlHTTPFunction · 0.64
ServeHTTPMethod · 0.64
runMethod · 0.64
TestConnBasicFunction · 0.64
TestFastPathFunction · 0.64
TestBigDataFunction · 0.64
TestDataTrickleFunction · 0.64