@@ -128,7 +128,7 @@ func makeBoolArshaler(t reflect.Type) *arshaler {
128128 fncs .marshal = func (enc * jsontext.Encoder , va addressableValue , mo * jsonopts.Struct ) error {
129129 xe := export .Encoder (enc )
130130 if mo .Format != "" && mo .FormatDepth == xe .Tokens .Depth () {
131- return newInvalidFormatError (enc , t , mo )
131+ return newInvalidFormatError (enc , t )
132132 }
133133
134134 // Optimize for marshaling without preceding whitespace.
@@ -153,7 +153,7 @@ func makeBoolArshaler(t reflect.Type) *arshaler {
153153 fncs .unmarshal = func (dec * jsontext.Decoder , va addressableValue , uo * jsonopts.Struct ) error {
154154 xd := export .Decoder (dec )
155155 if uo .Format != "" && uo .FormatDepth == xd .Tokens .Depth () {
156- return newInvalidFormatError (dec , t , uo )
156+ return newInvalidFormatError (dec , t )
157157 }
158158 tok , err := dec .ReadToken ()
159159 if err != nil {
@@ -190,7 +190,7 @@ func makeBoolArshaler(t reflect.Type) *arshaler {
190190 return nil
191191 }
192192 }
193- return newUnmarshalErrorAfterWithSkipping (dec , uo , t , nil )
193+ return newUnmarshalErrorAfterWithSkipping (dec , t , nil )
194194 }
195195 return & fncs
196196}
@@ -200,7 +200,7 @@ func makeStringArshaler(t reflect.Type) *arshaler {
200200 fncs .marshal = func (enc * jsontext.Encoder , va addressableValue , mo * jsonopts.Struct ) error {
201201 xe := export .Encoder (enc )
202202 if mo .Format != "" && mo .FormatDepth == xe .Tokens .Depth () {
203- return newInvalidFormatError (enc , t , mo )
203+ return newInvalidFormatError (enc , t )
204204 }
205205
206206 // Optimize for marshaling without preceding whitespace.
@@ -237,7 +237,7 @@ func makeStringArshaler(t reflect.Type) *arshaler {
237237 fncs .unmarshal = func (dec * jsontext.Decoder , va addressableValue , uo * jsonopts.Struct ) error {
238238 xd := export .Decoder (dec )
239239 if uo .Format != "" && uo .FormatDepth == xd .Tokens .Depth () {
240- return newInvalidFormatError (dec , t , uo )
240+ return newInvalidFormatError (dec , t )
241241 }
242242 var flags jsonwire.ValueFlags
243243 val , err := xd .ReadValue (& flags )
@@ -327,7 +327,7 @@ func makeBytesArshaler(t reflect.Type, fncs *arshaler) *arshaler {
327327 mo .Format = ""
328328 return marshalArray (enc , va , mo )
329329 default :
330- return newInvalidFormatError (enc , t , mo )
330+ return newInvalidFormatError (enc , t )
331331 }
332332 } else if mo .Flags .Get (jsonflags .FormatByteArrayAsArray ) && va .Kind () == reflect .Array {
333333 return marshalArray (enc , va , mo )
@@ -365,7 +365,7 @@ func makeBytesArshaler(t reflect.Type, fncs *arshaler) *arshaler {
365365 uo .Format = ""
366366 return unmarshalArray (dec , va , uo )
367367 default :
368- return newInvalidFormatError (dec , t , uo )
368+ return newInvalidFormatError (dec , t )
369369 }
370370 } else if uo .Flags .Get (jsonflags .FormatByteArrayAsArray ) && va .Kind () == reflect .Array {
371371 return unmarshalArray (dec , va , uo )
@@ -433,7 +433,7 @@ func makeIntArshaler(t reflect.Type) *arshaler {
433433 fncs .marshal = func (enc * jsontext.Encoder , va addressableValue , mo * jsonopts.Struct ) error {
434434 xe := export .Encoder (enc )
435435 if mo .Format != "" && mo .FormatDepth == xe .Tokens .Depth () {
436- return newInvalidFormatError (enc , t , mo )
436+ return newInvalidFormatError (enc , t )
437437 }
438438
439439 // Optimize for marshaling without preceding whitespace or string escaping.
@@ -454,7 +454,7 @@ func makeIntArshaler(t reflect.Type) *arshaler {
454454 fncs .unmarshal = func (dec * jsontext.Decoder , va addressableValue , uo * jsonopts.Struct ) error {
455455 xd := export .Decoder (dec )
456456 if uo .Format != "" && uo .FormatDepth == xd .Tokens .Depth () {
457- return newInvalidFormatError (dec , t , uo )
457+ return newInvalidFormatError (dec , t )
458458 }
459459 stringify := xd .Tokens .Last .NeedObjectName () || uo .Flags .Get (jsonflags .StringifyNumbers )
460460 var flags jsonwire.ValueFlags
@@ -520,7 +520,7 @@ func makeUintArshaler(t reflect.Type) *arshaler {
520520 fncs .marshal = func (enc * jsontext.Encoder , va addressableValue , mo * jsonopts.Struct ) error {
521521 xe := export .Encoder (enc )
522522 if mo .Format != "" && mo .FormatDepth == xe .Tokens .Depth () {
523- return newInvalidFormatError (enc , t , mo )
523+ return newInvalidFormatError (enc , t )
524524 }
525525
526526 // Optimize for marshaling without preceding whitespace or string escaping.
@@ -541,7 +541,7 @@ func makeUintArshaler(t reflect.Type) *arshaler {
541541 fncs .unmarshal = func (dec * jsontext.Decoder , va addressableValue , uo * jsonopts.Struct ) error {
542542 xd := export .Decoder (dec )
543543 if uo .Format != "" && uo .FormatDepth == xd .Tokens .Depth () {
544- return newInvalidFormatError (dec , t , uo )
544+ return newInvalidFormatError (dec , t )
545545 }
546546 stringify := xd .Tokens .Last .NeedObjectName () || uo .Flags .Get (jsonflags .StringifyNumbers )
547547 var flags jsonwire.ValueFlags
@@ -602,7 +602,7 @@ func makeFloatArshaler(t reflect.Type) *arshaler {
602602 if mo .Format == "nonfinite" {
603603 allowNonFinite = true
604604 } else {
605- return newInvalidFormatError (enc , t , mo )
605+ return newInvalidFormatError (enc , t )
606606 }
607607 }
608608
@@ -637,7 +637,7 @@ func makeFloatArshaler(t reflect.Type) *arshaler {
637637 if uo .Format == "nonfinite" {
638638 allowNonFinite = true
639639 } else {
640- return newInvalidFormatError (dec , t , uo )
640+ return newInvalidFormatError (dec , t )
641641 }
642642 }
643643 stringify := xd .Tokens .Last .NeedObjectName () || uo .Flags .Get (jsonflags .StringifyNumbers )
@@ -737,7 +737,7 @@ func makeMapArshaler(t reflect.Type) *arshaler {
737737 emitNull = false
738738 mo .Format = ""
739739 default :
740- return newInvalidFormatError (enc , t , mo )
740+ return newInvalidFormatError (enc , t )
741741 }
742742 }
743743
@@ -882,7 +882,7 @@ func makeMapArshaler(t reflect.Type) *arshaler {
882882 case "emitnull" , "emitempty" :
883883 uo .Format = "" // only relevant for marshaling
884884 default :
885- return newInvalidFormatError (dec , t , uo )
885+ return newInvalidFormatError (dec , t )
886886 }
887887 }
888888 tok , err := dec .ReadToken ()
@@ -992,7 +992,7 @@ func makeMapArshaler(t reflect.Type) *arshaler {
992992 }
993993 return errUnmarshal
994994 }
995- return newUnmarshalErrorAfterWithSkipping (dec , uo , t , nil )
995+ return newUnmarshalErrorAfterWithSkipping (dec , t , nil )
996996 }
997997 return & fncs
998998}
@@ -1037,7 +1037,7 @@ func makeStructArshaler(t reflect.Type) *arshaler {
10371037 fncs .marshal = func (enc * jsontext.Encoder , va addressableValue , mo * jsonopts.Struct ) error {
10381038 xe := export .Encoder (enc )
10391039 if mo .Format != "" && mo .FormatDepth == xe .Tokens .Depth () {
1040- return newInvalidFormatError (enc , t , mo )
1040+ return newInvalidFormatError (enc , t )
10411041 }
10421042 once .Do (init )
10431043 if errInit != nil && ! mo .Flags .Get (jsonflags .ReportErrorsWithLegacySemantics ) {
@@ -1199,7 +1199,7 @@ func makeStructArshaler(t reflect.Type) *arshaler {
11991199 fncs .unmarshal = func (dec * jsontext.Decoder , va addressableValue , uo * jsonopts.Struct ) error {
12001200 xd := export .Decoder (dec )
12011201 if uo .Format != "" && uo .FormatDepth == xd .Tokens .Depth () {
1202- return newInvalidFormatError (dec , t , uo )
1202+ return newInvalidFormatError (dec , t )
12031203 }
12041204 tok , err := dec .ReadToken ()
12051205 if err != nil {
@@ -1317,7 +1317,7 @@ func makeStructArshaler(t reflect.Type) *arshaler {
13171317 }
13181318 return errUnmarshal
13191319 }
1320- return newUnmarshalErrorAfterWithSkipping (dec , uo , t , nil )
1320+ return newUnmarshalErrorAfterWithSkipping (dec , t , nil )
13211321 }
13221322 return & fncs
13231323}
@@ -1414,7 +1414,7 @@ func makeSliceArshaler(t reflect.Type) *arshaler {
14141414 emitNull = false
14151415 mo .Format = ""
14161416 default :
1417- return newInvalidFormatError (enc , t , mo )
1417+ return newInvalidFormatError (enc , t )
14181418 }
14191419 }
14201420
@@ -1462,7 +1462,7 @@ func makeSliceArshaler(t reflect.Type) *arshaler {
14621462 case "emitnull" , "emitempty" :
14631463 uo .Format = "" // only relevant for marshaling
14641464 default :
1465- return newInvalidFormatError (dec , t , uo )
1465+ return newInvalidFormatError (dec , t )
14661466 }
14671467 }
14681468
@@ -1518,7 +1518,7 @@ func makeSliceArshaler(t reflect.Type) *arshaler {
15181518 }
15191519 return errUnmarshal
15201520 }
1521- return newUnmarshalErrorAfterWithSkipping (dec , uo , t , nil )
1521+ return newUnmarshalErrorAfterWithSkipping (dec , t , nil )
15221522 }
15231523 return & fncs
15241524}
@@ -1539,7 +1539,7 @@ func makeArrayArshaler(t reflect.Type) *arshaler {
15391539 fncs .marshal = func (enc * jsontext.Encoder , va addressableValue , mo * jsonopts.Struct ) error {
15401540 xe := export .Encoder (enc )
15411541 if mo .Format != "" && mo .FormatDepth == xe .Tokens .Depth () {
1542- return newInvalidFormatError (enc , t , mo )
1542+ return newInvalidFormatError (enc , t )
15431543 }
15441544 once .Do (init )
15451545 if err := enc .WriteToken (jsontext .BeginArray ); err != nil {
@@ -1563,7 +1563,7 @@ func makeArrayArshaler(t reflect.Type) *arshaler {
15631563 fncs .unmarshal = func (dec * jsontext.Decoder , va addressableValue , uo * jsonopts.Struct ) error {
15641564 xd := export .Decoder (dec )
15651565 if uo .Format != "" && uo .FormatDepth == xd .Tokens .Depth () {
1566- return newInvalidFormatError (dec , t , uo )
1566+ return newInvalidFormatError (dec , t )
15671567 }
15681568 tok , err := dec .ReadToken ()
15691569 if err != nil {
@@ -1616,7 +1616,7 @@ func makeArrayArshaler(t reflect.Type) *arshaler {
16161616 }
16171617 return errUnmarshal
16181618 }
1619- return newUnmarshalErrorAfterWithSkipping (dec , uo , t , nil )
1619+ return newUnmarshalErrorAfterWithSkipping (dec , t , nil )
16201620 }
16211621 return & fncs
16221622}
@@ -1706,7 +1706,7 @@ func makeInterfaceArshaler(t reflect.Type) *arshaler {
17061706 fncs .marshal = func (enc * jsontext.Encoder , va addressableValue , mo * jsonopts.Struct ) error {
17071707 xe := export .Encoder (enc )
17081708 if mo .Format != "" && mo .FormatDepth == xe .Tokens .Depth () {
1709- return newInvalidFormatError (enc , t , mo )
1709+ return newInvalidFormatError (enc , t )
17101710 }
17111711 if va .IsNil () {
17121712 return enc .WriteToken (jsontext .Null )
@@ -1746,7 +1746,7 @@ func makeInterfaceArshaler(t reflect.Type) *arshaler {
17461746 fncs .unmarshal = func (dec * jsontext.Decoder , va addressableValue , uo * jsonopts.Struct ) error {
17471747 xd := export .Decoder (dec )
17481748 if uo .Format != "" && uo .FormatDepth == xd .Tokens .Depth () {
1749- return newInvalidFormatError (dec , t , uo )
1749+ return newInvalidFormatError (dec , t )
17501750 }
17511751 if uo .Flags .Get (jsonflags .MergeWithLegacySemantics ) && ! va .IsNil () {
17521752 // Legacy merge behavior is difficult to explain.
@@ -1795,7 +1795,7 @@ func makeInterfaceArshaler(t reflect.Type) *arshaler {
17951795
17961796 k := dec .PeekKind ()
17971797 if ! isAnyType (t ) {
1798- return newUnmarshalErrorBeforeWithSkipping (dec , uo , t , internal .ErrNilInterface )
1798+ return newUnmarshalErrorBeforeWithSkipping (dec , t , internal .ErrNilInterface )
17991799 }
18001800 switch k {
18011801 case 'f' , 't' :
0 commit comments