MCPcopy
hub / github.com/cli/cli / StringResponse

Function StringResponse

pkg/httpmock/stub.go:124–128  ·  view source on GitHub ↗
(body string)

Source from the content-addressed store, hash-verified

122}
123
124func StringResponse(body string) Responder {
125 return func(req *http.Request) (*http.Response, error) {
126 return httpResponse(200, req, bytes.NewBufferString(body)), nil
127 }
128}
129
130func BinaryResponse(body []byte) Responder {
131 return func(req *http.Request) (*http.Response, error) {

Callers 15

TestGetCachesFunction · 0.92
TestListFunction · 0.92
TestSearchFunction · 0.92
TestListCategoriesFunction · 0.92
TestGetByNumberFunction · 0.92
TestGetWithCommentsFunction · 0.92
TestGetCommentRepliesFunction · 0.92
TestCreateFunction · 0.92
TestListLabelsFunction · 0.92
TestEditDiscussionLabelsFunction · 0.92
TestUpdateFunction · 0.92
TestAddCommentFunction · 0.92

Calls 1

httpResponseFunction · 0.85

Tested by 15

TestGetCachesFunction · 0.74
TestListFunction · 0.74
TestSearchFunction · 0.74
TestListCategoriesFunction · 0.74
TestGetByNumberFunction · 0.74
TestGetWithCommentsFunction · 0.74
TestGetCommentRepliesFunction · 0.74
TestCreateFunction · 0.74
TestListLabelsFunction · 0.74
TestEditDiscussionLabelsFunction · 0.74
TestUpdateFunction · 0.74
TestAddCommentFunction · 0.74