MCPcopy Index your code
hub / github.com/labstack/echo / gzipString

Function gzipString

middleware/decompress_test.go:237–251  ·  view source on GitHub ↗
(body string)

Source from the content-addressed store, hash-verified

235}
236
237func gzipString(body string) ([]byte, error) {
238 var buf bytes.Buffer
239 gz := gzip.NewWriter(&buf)
240
241 _, err := gz.Write([]byte(body))
242 if err != nil {
243 return nil, err
244 }
245
246 if err := gz.Close(); err != nil {
247 return nil, err
248 }
249
250 return buf.Bytes(), nil
251}
252
253func TestDecompress_WithinLimit(t *testing.T) {
254 e := echo.New()

Calls 2

WriteMethod · 0.45
CloseMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…