Skip to content

Commit bad2ecb

Browse files
chore: avoid embedding reflect.Type for dead code elimination
1 parent c4655f2 commit bad2ecb

4 files changed

Lines changed: 8 additions & 8 deletions

File tree

internal/apiform/encoder.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ type encoderField struct {
4242
}
4343

4444
type encoderEntry struct {
45-
reflect.Type
45+
typ reflect.Type
4646
dateFormat string
4747
root bool
4848
}
@@ -59,7 +59,7 @@ func (e *encoder) marshal(value interface{}, writer *multipart.Writer) error {
5959

6060
func (e *encoder) typeEncoder(t reflect.Type) encoderFunc {
6161
entry := encoderEntry{
62-
Type: t,
62+
typ: t,
6363
dateFormat: e.dateFormat,
6464
root: e.root,
6565
}

internal/apijson/decoder.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ type decoderField struct {
7575
}
7676

7777
type decoderEntry struct {
78-
reflect.Type
78+
typ reflect.Type
7979
dateFormat string
8080
root bool
8181
}
@@ -91,7 +91,7 @@ func (d *decoderBuilder) unmarshal(raw []byte, to any) error {
9191

9292
func (d *decoderBuilder) typeDecoder(t reflect.Type) decoderFunc {
9393
entry := decoderEntry{
94-
Type: t,
94+
typ: t,
9595
dateFormat: d.dateFormat,
9696
root: d.root,
9797
}

internal/apijson/encoder.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ type encoderField struct {
4646
}
4747

4848
type encoderEntry struct {
49-
reflect.Type
49+
typ reflect.Type
5050
dateFormat string
5151
root bool
5252
}
@@ -63,7 +63,7 @@ func (e *encoder) marshal(value interface{}) ([]byte, error) {
6363

6464
func (e *encoder) typeEncoder(t reflect.Type) encoderFunc {
6565
entry := encoderEntry{
66-
Type: t,
66+
typ: t,
6767
dateFormat: e.dateFormat,
6868
root: e.root,
6969
}

internal/apiquery/encoder.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ type encoderField struct {
2929
}
3030

3131
type encoderEntry struct {
32-
reflect.Type
32+
typ reflect.Type
3333
dateFormat string
3434
root bool
3535
settings QuerySettings
@@ -42,7 +42,7 @@ type Pair struct {
4242

4343
func (e *encoder) typeEncoder(t reflect.Type) encoderFunc {
4444
entry := encoderEntry{
45-
Type: t,
45+
typ: t,
4646
dateFormat: e.dateFormat,
4747
root: e.root,
4848
settings: e.settings,

0 commit comments

Comments
 (0)