File tree Expand file tree Collapse file tree 2 files changed +9
-3
lines changed Expand file tree Collapse file tree 2 files changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -84,6 +84,7 @@ func setDefaultAllowedErrors() {
84
84
{Err : "context.Canceled" , Fun : "(context.Context).Err" },
85
85
// pkg/encoding/json
86
86
{Err : "io.EOF" , Fun : "(*encoding/json.Decoder).Decode" },
87
+ {Err : "io.EOF" , Fun : "(*encoding/json.Decoder).Token" },
87
88
// pkg/encoding/csv
88
89
{Err : "io.EOF" , Fun : "(*encoding/csv.Reader).Read" },
89
90
// pkg/mime/multipart
Original file line number Diff line number Diff line change @@ -251,11 +251,16 @@ func ContextErr(ctx context.Context) error {
251
251
return nil
252
252
}
253
253
254
- func JSONReader (r io. Reader ) {
255
- err := json . NewDecoder ( r ). Decode ( nil )
254
+ func JSONReader (dec * json. Decoder ) ( err error ) {
255
+ _ , err = dec . Token ( )
256
256
if err == io .EOF {
257
- fmt .Println (err )
257
+ return
258
+ }
259
+ err = dec .Decode (nil )
260
+ if err == io .EOF {
261
+ return
258
262
}
263
+ return
259
264
}
260
265
261
266
func CSVReader (r io.Reader ) {
You can’t perform that action at this time.
0 commit comments