Skip to content

Commit

Permalink
fix: internalized compressionNone and compressionEmpty
Browse files Browse the repository at this point in the history
  • Loading branch information
hyunuk committed Jan 8, 2022
1 parent 6a456be commit c2317d8
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
10 changes: 5 additions & 5 deletions config/configcompression/compressionType.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,12 @@ const (
CompressionDeflate CompressionType = "deflate"
CompressionSnappy CompressionType = "snappy"
CompressionZstd CompressionType = "zstd"
CompressionNone CompressionType = "none"
CompressionEmpty CompressionType = ""
compressionNone CompressionType = "none"
compressionEmpty CompressionType = ""
)

func IsCompressed(compressionType CompressionType) bool {
return compressionType != CompressionEmpty && compressionType != CompressionNone
return compressionType != compressionEmpty && compressionType != compressionNone
}

func (ct *CompressionType) UnmarshalText(in []byte) error {
Expand All @@ -39,8 +39,8 @@ func (ct *CompressionType) UnmarshalText(in []byte) error {
CompressionDeflate,
CompressionSnappy,
CompressionZstd,
CompressionNone,
CompressionEmpty:
compressionNone,
compressionEmpty:
*ct = typ
return nil
default:
Expand Down
2 changes: 1 addition & 1 deletion config/configcompression/compressionType_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ func TestUnmarshalText(t *testing.T) {
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
temp := CompressionNone
temp := compressionNone
err := temp.UnmarshalText(tt.compressionName)
if tt.shouldError {
assert.Error(t, err)
Expand Down

0 comments on commit c2317d8

Please sign in to comment.