Skip to content

Commit f318fef

Browse files
committed
Replace interface{} with any
1 parent 2e35008 commit f318fef

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

packet_buffer.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ const omit = "omit"
4848
// bytes that have been written into.
4949
//
5050
//nolint:gocognit,cyclop
51-
func (b *packetBuffer) write(v interface{}) error {
51+
func (b *packetBuffer) write(v any) error {
5252
value := reflect.ValueOf(v)
5353

5454
// Indirect is safe to call on non-pointers, and
@@ -129,7 +129,7 @@ func (b *packetBuffer) write(v interface{}) error {
129129
// bytes that have already been read.
130130
//
131131
//nolint:gocognit,cyclop
132-
func (b *packetBuffer) read(v interface{}) error {
132+
func (b *packetBuffer) read(v any) error {
133133
ptr := reflect.ValueOf(v)
134134
if ptr.Kind() != reflect.Ptr {
135135
return errBadReadParameter
@@ -232,7 +232,7 @@ func (b *packetBuffer) split(size int) packetBuffer {
232232
// This fuction doesn't check that Write() will succeed,
233233
// and may return unexpectedly large results for those
234234
// structures that Write() will fail on.
235-
func wireSize(v interface{}) int {
235+
func wireSize(v any) int {
236236
value := reflect.ValueOf(v)
237237
// Indirect is safe to call on non-pointers, and
238238
// will simply return the same value in such cases

packet_stringifier.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ func stringify(p Packet) string {
3737
}
3838

3939
//nolint:gocognit,cyclop
40-
func formatField(name string, format string, f interface{}, indent string) string {
40+
func formatField(name string, format string, f any, indent string) string {
4141
out := indent
4242
value := reflect.ValueOf(f)
4343

0 commit comments

Comments
 (0)