MCPcopy
hub / github.com/prometheus/client_golang / SetStatusCode

Method SetStatusCode

exp/api/remote/remote_headers.go:124–126  ·  view source on GitHub ↗

SetStatusCode sets the HTTP status code for the response. http.StatusNoContent is the default unless 5xx is set.

(code int)

Source from the content-addressed store, hash-verified

122
123// SetStatusCode sets the HTTP status code for the response. http.StatusNoContent is the default unless 5xx is set.
124func (w *WriteResponse) SetStatusCode(code int) {
125 w.statusCode = code
126}
127
128// StatusCode returns the current HTTP status code.
129func (w *WriteResponse) StatusCode() int {

Callers 3

TestWriteResponseFunction · 0.95
StoreMethod · 0.95
ServeHTTPMethod · 0.80

Calls

no outgoing calls

Tested by 2

TestWriteResponseFunction · 0.76
StoreMethod · 0.76