Skip to content

Commit 7c8d66f

Browse files
committed
json: minor cleanups: ioutil.ReadAll->io.ReadAll
Also, move the close-brace for the empty Decoder struct onto the same line as the open-brace.
1 parent 42a61b7 commit 7c8d66f

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

decoders/json/json.go

+2-4
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ import (
44
"encoding/json"
55
"fmt"
66
"io"
7-
"io/ioutil"
87
"reflect"
98

109
"github.com/vimeo/dials"
@@ -17,13 +16,12 @@ import (
1716
const JSONTagName = "json"
1817

1918
// Decoder is a decoder that knows how to work with text encoded in JSON
20-
type Decoder struct {
21-
}
19+
type Decoder struct{}
2220

2321
// Decode is a decoder that decodes the JSON from an io.Reader into the
2422
// appropriate struct.
2523
func (d *Decoder) Decode(r io.Reader, t *dials.Type) (reflect.Value, error) {
26-
jsonBytes, err := ioutil.ReadAll(r)
24+
jsonBytes, err := io.ReadAll(r)
2725
if err != nil {
2826
return reflect.Value{}, fmt.Errorf("error reading JSON: %s", err)
2927
}

0 commit comments

Comments
 (0)