Skip to content

Commit

Permalink
rename FieldDrain by FieldIgnore
Browse files Browse the repository at this point in the history
  • Loading branch information
redaLaanait committed Jan 9, 2024
1 parent bc0e276 commit 2ec1b60
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions codec_default_internal_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ func TestDecoder_InvalidDefault(t *testing.T) {
require.Error(t, err)
}

func TestDecoder_DrainField(t *testing.T) {
func TestDecoder_IgnoreField(t *testing.T) {
defer ConfigTeardown()

// write schema
Expand All @@ -81,7 +81,7 @@ func TestDecoder_DrainField(t *testing.T) {
]
}`)

schema.(*RecordSchema).Fields()[0].action = FieldDrain
schema.(*RecordSchema).Fields()[0].action = FieldIgnore
schema.(*RecordSchema).Fields()[1].action = FieldSetDefault

type TestRecord struct {
Expand Down
4 changes: 2 additions & 2 deletions codec_record.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ func decoderOfStruct(cfg *frozenConfig, schema Schema, typ reflect2.Type) ValDec
fields := make([]*structFieldDecoder, 0, len(rec.Fields()))

for _, field := range rec.Fields() {
if field.action == FieldDrain {
if field.action == FieldIgnore {
fields = append(fields, &structFieldDecoder{
decoder: createSkipDecoder(field.Type()),
})
Expand Down Expand Up @@ -256,7 +256,7 @@ func decoderOfRecord(cfg *frozenConfig, schema Schema, typ reflect2.Type) ValDec

fields := make([]recordMapDecoderField, len(rec.Fields()))
for i, field := range rec.Fields() {
if field.action == FieldDrain {
if field.action == FieldIgnore {
fields[i] = recordMapDecoderField{
name: field.Name(),
decoder: createSkipDecoder(field.Type()),
Expand Down
2 changes: 1 addition & 1 deletion schema.go
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ type Action string

// Action type constants.
const (
FieldDrain Action = "drain"
FieldIgnore Action = "ignore"
FieldSetDefault Action = "set_default"
)

Expand Down
2 changes: 1 addition & 1 deletion schema_compatibility.go
Original file line number Diff line number Diff line change
Expand Up @@ -383,7 +383,7 @@ func (c *SchemaCompatibility) resolveRecord(reader, writer Schema) (Schema, erro
// data race should not occur.
f.def = wf.def
f.hasDef = wf.hasDef
f.action = FieldDrain
f.action = FieldIgnore
fields = append(fields, f)
continue
}
Expand Down

0 comments on commit 2ec1b60

Please sign in to comment.