p2p/dnsdisc: using maps.Copy (#29377)

pull/29386/head
cui 6 months ago committed by GitHub
parent 3b77e0ff4b
commit 3754a6cc92
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 5
      p2p/dnsdisc/client_test.go

@ -20,6 +20,7 @@ import (
"context" "context"
"crypto/ecdsa" "crypto/ecdsa"
"errors" "errors"
"maps"
"reflect" "reflect"
"testing" "testing"
"time" "time"
@ -453,9 +454,7 @@ func (mr mapResolver) clear() {
} }
func (mr mapResolver) add(m map[string]string) { func (mr mapResolver) add(m map[string]string) {
for k, v := range m { maps.Copy(mr, m)
mr[k] = v
}
} }
func (mr mapResolver) LookupTXT(ctx context.Context, name string) ([]string, error) { func (mr mapResolver) LookupTXT(ctx context.Context, name string) ([]string, error) {

Loading…
Cancel
Save