mirror of
https://github.com/VictoriaMetrics/VictoriaMetrics.git
synced 2024-12-01 14:47:38 +00:00
6320a19a8c
This simplifies testing with `go test ./app/victoria-metrics` without the need to remember to pass `-tags=integration` to Go commands.
12 lines
243 B
Go
12 lines
243 B
Go
package test
|
|
|
|
import "github.com/golang/snappy"
|
|
|
|
// Compress marshals and compresses wr.
|
|
func Compress(wr WriteRequest) ([]byte, error) {
|
|
data, err := wr.Marshal()
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return snappy.Encode(nil, data), nil
|
|
}
|