Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion compression.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ const (

var (
flateWriterPools [maxCompressionLevel - minCompressionLevel + 1]sync.Pool
flateReaderPool = sync.Pool{New: func() interface{} {
flateReaderPool = sync.Pool{New: func() any {
return flate.NewReader(nil)
}}
)
Expand Down
4 changes: 2 additions & 2 deletions conn.go
Original file line number Diff line number Diff line change
Expand Up @@ -227,9 +227,9 @@ func isValidReceivedCloseCode(code int) bool {
// interface. The type of the value stored in a pool is not specified.
type BufferPool interface {
// Get gets a value from the pool or returns nil if the pool is empty.
Get() interface{}
Get() any
// Put adds a value to the pool.
Put(interface{})
Put(any)
}

// writePoolData is the type added to the write buffer pool. This wrapper is
Expand Down
6 changes: 3 additions & 3 deletions conn_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -227,16 +227,16 @@ func TestControl(t *testing.T) {

// simpleBufferPool is an implementation of BufferPool for TestWriteBufferPool.
type simpleBufferPool struct {
v interface{}
v any
}

func (p *simpleBufferPool) Get() interface{} {
func (p *simpleBufferPool) Get() any {
v := p.v
p.v = nil
return v
}

func (p *simpleBufferPool) Put(v interface{}) {
func (p *simpleBufferPool) Put(v any) {
p.v = v
}

Expand Down
8 changes: 4 additions & 4 deletions json.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,15 @@ import (
// WriteJSON writes the JSON encoding of v as a message.
//
// Deprecated: Use c.WriteJSON instead.
func WriteJSON(c *Conn, v interface{}) error {
func WriteJSON(c *Conn, v any) error {
return c.WriteJSON(v)
}

// WriteJSON writes the JSON encoding of v as a message.
//
// See the documentation for encoding/json Marshal for details about the
// conversion of Go values to JSON.
func (c *Conn) WriteJSON(v interface{}) error {
func (c *Conn) WriteJSON(v any) error {
w, err := c.NextWriter(TextMessage)
if err != nil {
return err
Expand All @@ -37,7 +37,7 @@ func (c *Conn) WriteJSON(v interface{}) error {
// it in the value pointed to by v.
//
// Deprecated: Use c.ReadJSON instead.
func ReadJSON(c *Conn, v interface{}) error {
func ReadJSON(c *Conn, v any) error {
return c.ReadJSON(v)
}

Expand All @@ -46,7 +46,7 @@ func ReadJSON(c *Conn, v interface{}) error {
//
// See the documentation for the encoding/json Unmarshal function for details
// about the conversion of JSON to a Go value.
func (c *Conn) ReadJSON(v interface{}) error {
func (c *Conn) ReadJSON(v any) error {
_, r, err := c.NextReader()
if err != nil {
return err
Expand Down