@@ -137,7 +137,7 @@ func (bigEndian) GoString() string { return "binary.BigEndian" }
137
137
// blank (_) field names is skipped; i.e., blank field names
138
138
// may be used for padding.
139
139
// When reading into a struct, all non-blank fields must be exported.
140
- func Read (r io.Reader , order ByteOrder , data interface {} ) error {
140
+ func Read (r io.Reader , order ByteOrder , data any ) error {
141
141
// Fast path for basic types and slices.
142
142
if n := intDataSize (data ); n != 0 {
143
143
var b [8 ]byte
@@ -229,7 +229,7 @@ func Read(r io.Reader, order ByteOrder, data interface{}) error {
229
229
// and read from successive fields of the data.
230
230
// When writing structs, zero values are written for fields
231
231
// with blank (_) field names.
232
- func Write (w io.Writer , order ByteOrder , data interface {} ) error {
232
+ func Write (w io.Writer , order ByteOrder , data any ) error {
233
233
// Fast path for basic types and slices.
234
234
if n := intDataSize (data ); n != 0 {
235
235
var b [8 ]byte
@@ -339,7 +339,7 @@ func Write(w io.Writer, order ByteOrder, data interface{}) error {
339
339
// Size returns how many bytes Write would generate to encode the value v, which
340
340
// must be a fixed-size value or a slice of fixed-size values, or a pointer to such data.
341
341
// If v is neither of these, Size returns -1.
342
- func Size (v interface {} ) int {
342
+ func Size (v any ) int {
343
343
return dataSize (reflect .Indirect (reflect .ValueOf (v )))
344
344
}
345
345
@@ -607,7 +607,7 @@ func (e *encoder) skip(v reflect.Value) {
607
607
608
608
// intDataSize returns the size of the data required to represent the data when encoded.
609
609
// It returns zero if the type cannot be implemented by the fast path in Read or Write.
610
- func intDataSize (data interface {} ) int {
610
+ func intDataSize (data any ) int {
611
611
switch data := data .(type ) {
612
612
case int8 , * int8 , * uint8 :
613
613
return 1
0 commit comments