Skip to content

Commit

Permalink
fix: interalize none and empty
Browse files Browse the repository at this point in the history
  • Loading branch information
hyunuk committed Jan 13, 2022
1 parent 396f418 commit bea771c
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 (
Deflate CompressionType = "deflate"
Snappy CompressionType = "snappy"
Zstd CompressionType = "zstd"
None CompressionType = "none"
Empty CompressionType = ""
none CompressionType = "none"
empty CompressionType = ""
)

func IsCompressed(compressionType CompressionType) bool {
return compressionType != Empty && compressionType != None
return compressionType != empty && compressionType != none
}

func (ct *CompressionType) UnmarshalText(in []byte) error {
Expand All @@ -39,8 +39,8 @@ func (ct *CompressionType) UnmarshalText(in []byte) error {
Deflate,
Snappy,
Zstd,
None,
Empty:
none,
empty:
*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 := None
temp := none
err := temp.UnmarshalText(tt.compressionName)
if tt.shouldError {
assert.Error(t, err)
Expand Down

0 comments on commit bea771c

Please sign in to comment.