mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2025-11-08 15:16:13 +08:00
go fmt
This commit is contained in:
@@ -12,11 +12,11 @@ import (
|
||||
"github.com/klauspost/compress/zstd"
|
||||
)
|
||||
|
||||
var(
|
||||
var (
|
||||
UnsupportedCompression = fmt.Errorf("unsupported compression")
|
||||
)
|
||||
|
||||
func MaybeGzipData(input []byte) ([]byte) {
|
||||
func MaybeGzipData(input []byte) []byte {
|
||||
if IsGzippedContent(input) {
|
||||
return input
|
||||
}
|
||||
@@ -24,13 +24,13 @@ func MaybeGzipData(input []byte) ([]byte) {
|
||||
if err != nil {
|
||||
return input
|
||||
}
|
||||
if len(gzipped) * 10 > len(input) * 9 {
|
||||
if len(gzipped)*10 > len(input)*9 {
|
||||
return input
|
||||
}
|
||||
return gzipped
|
||||
}
|
||||
|
||||
func MaybeDecompressData(input []byte) ([]byte) {
|
||||
func MaybeDecompressData(input []byte) []byte {
|
||||
uncompressed, err := DecompressData(input)
|
||||
if err != nil {
|
||||
if err != UnsupportedCompression {
|
||||
|
||||
Reference in New Issue
Block a user