(body string)
| 235 | } |
| 236 | |
| 237 | func 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 | |
| 253 | func TestDecompress_WithinLimit(t *testing.T) { |
| 254 | e := echo.New() |
no test coverage detected
searching dependent graphs…