Adding go lint to more modules (#738)

This commit is contained in:
Igor Gov
2022-02-01 12:08:55 +02:00
committed by GitHub
parent c0f6f2a049
commit 602225bb36
34 changed files with 195 additions and 1326 deletions

View File

@@ -1,8 +1,6 @@
package kafka
import (
"errors"
"github.com/segmentio/kafka-go/compress"
)
@@ -12,19 +10,3 @@ type CompressionCodec = compress.Codec
// TODO: this file should probably go away once the internals of the package
// have moved to use the protocol package.
const (
compressionCodecMask = 0x07
)
var (
errUnknownCodec = errors.New("the compression code is invalid or its codec has not been imported")
)
// resolveCodec looks up a codec by Code()
func resolveCodec(code int8) (CompressionCodec, error) {
codec := compress.Compression(code).Codec()
if codec == nil {
return nil, errUnknownCodec
}
return codec, nil
}