mirror of
https://github.com/nbd-wtf/go-nostr.git
synced 2025-05-02 23:00:14 +02:00
rename interface{} to any.
This commit is contained in:
parent
ec3f1287c4
commit
326d2790de
@ -1,8 +1,9 @@
|
||||
package nostr
|
||||
|
||||
import (
|
||||
"github.com/gorilla/websocket"
|
||||
"sync"
|
||||
|
||||
"github.com/gorilla/websocket"
|
||||
)
|
||||
|
||||
type Connection struct {
|
||||
@ -16,7 +17,7 @@ func NewConnection(socket *websocket.Conn) *Connection {
|
||||
}
|
||||
}
|
||||
|
||||
func (c *Connection) WriteJSON(v interface{}) error {
|
||||
func (c *Connection) WriteJSON(v any) error {
|
||||
c.mutex.Lock()
|
||||
defer c.mutex.Unlock()
|
||||
return c.socket.WriteJSON(v)
|
||||
|
2
relay.go
2
relay.go
@ -381,7 +381,7 @@ func (r *Relay) Auth(ctx context.Context, event Event) (Status, error) {
|
||||
defer r.okCallbacks.Delete(event.ID)
|
||||
|
||||
// send AUTH
|
||||
authResponse := []interface{}{"AUTH", event}
|
||||
authResponse := []any{"AUTH", event}
|
||||
debugLog("{%s} sending %v\n", r.URL, authResponse)
|
||||
if err := r.Connection.WriteJSON(authResponse); err != nil {
|
||||
// status will be "failed"
|
||||
|
@ -66,7 +66,7 @@ func (sub *Subscription) Sub(ctx context.Context, filters Filters) {
|
||||
func (sub *Subscription) Fire() error {
|
||||
sub.Relay.subscriptions.Store(sub.GetID(), sub)
|
||||
|
||||
message := []interface{}{"REQ", sub.GetID()}
|
||||
message := []any{"REQ", sub.GetID()}
|
||||
for _, filter := range sub.Filters {
|
||||
message = append(message, filter)
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user