Skip to content

Commit b3465f1

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

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
@@ -58,7 +58,7 @@ type encoderField struct {
5858
}
5959

6060
type encoderEntry struct {
61-
reflect.Type
61+
typ reflect.Type
6262
dateFormat string
6363
arrayFmt string
6464
root bool
@@ -76,7 +76,7 @@ func (e *encoder) marshal(value any, writer *multipart.Writer) error {
7676

7777
func (e *encoder) typeEncoder(t reflect.Type) encoderFunc {
7878
entry := encoderEntry{
79-
Type: t,
79+
typ: t,
8080
dateFormat: e.dateFormat,
8181
arrayFmt: e.arrayFmt,
8282
root: e.root,

internal/apijson/decoder.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ type decoderField struct {
8080
}
8181

8282
type decoderEntry struct {
83-
reflect.Type
83+
typ reflect.Type
8484
dateFormat string
8585
root bool
8686
}
@@ -108,7 +108,7 @@ func (d *decoderBuilder) unmarshalWithExactness(raw []byte, to any) (exactness,
108108

109109
func (d *decoderBuilder) typeDecoder(t reflect.Type) decoderFunc {
110110
entry := decoderEntry{
111-
Type: t,
111+
typ: t,
112112
dateFormat: d.dateFormat,
113113
root: d.root,
114114
}

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 any) ([]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)