Repository: libp2p/go-libp2p
Pull request #2608 (2023-10-16 12:04:44)

chore: fix typos


Patch:
diff --git a/examples/echo/README.md b/examples/echo/README.md
index 38071600..4c30609f 100644
--- a/examples/echo/README.md
+++ b/examples/echo/README.md
@@ -42,7 +42,7 @@ The `makeBasicHost()` function creates a [go-libp2p-basichost](https://godoc.org
 
 In order to create the swarm (and a `basichost`), the example needs:
 
-- An [ipfs-procotol ID](https://godoc.org/github.com/libp2p/go-libp2p-peer#ID) like `QmNtX1cvrm2K6mQmMEaMxAuB4rTexhd87vpYVot4sEZzxc`. The example autogenerates a key pair on every run and uses an ID extracted from the public key (the hash of the public key). When using `-insecure`, it leaves the connection unencrypted (otherwise, it uses the key pair to encrypt communications).
+- An [ipfs-protocol ID](https://godoc.org/github.com/libp2p/go-libp2p-peer#ID) like `QmNtX1cvrm2K6mQmMEaMxAuB4rTexhd87vpYVot4sEZzxc`. The example autogenerates a key pair on every run and uses an ID extracted from the public key (the hash of the public key). When using `-insecure`, it leaves the connection unencrypted (otherwise, it uses the key pair to encrypt communications).
 - A [Multiaddress](https://godoc.org/github.com/multiformats/go-multiaddr), which indicates how to reach this peer. There can be several of them (using different protocols or locations for example). Example: `/ip4/127.0.0.1/tcp/1234`.
 - A [go-libp2p-peerstore](https://godoc.org/github.com/libp2p/go-libp2p-peerstore), which is used as an address book which matches node IDs to the multiaddresses through which they can be contacted. This peerstore gets autopopulated when manually opening a connection (with [`Connect()`](https://godoc.org/github.com/libp2p/go-libp2p/p2p/host/basic#BasicHost.Connect). Alternatively, we can manually [`AddAddr()`](https://godoc.org/github.com/libp2p/go-libp2p-peerstore#AddrManager.AddAddr) as in the example.
 
diff --git a/examples/relay/main.go b/examples/relay/main.go
index e8fa8b7b..7e16b1b1 100644
--- a/examples/relay/main.go
+++ b/examples/relay/main.go
@@ -27,7 +27,7 @@ func run() {
 	unreachable1, err := libp2p.New(
 		libp2p.NoListenAddrs,
 		// Usually EnableRelay() is not required as it is enabled by default
-		// but NoListenAddrs overrides this, so we're adding it in explictly again.
+		// but NoListenAddrs overrides this, so we're adding it in explicitly again.
 		libp2p.EnableRelay(),
 	)
 	if err != nil {
diff --git a/p2p/host/basic/basic_host.go b/p2p/host/basic/basic_host.go
index acbb0984..8e6e8efe 100644
--- a/p2p/host/basic/basic_host.go
+++ b/p2p/host/basic/basic_host.go
@@ -542,7 +542,7 @@ func (h *BasicHost) background() {
 			h.updateLocalIpAddr()
 		}
 		// Request addresses anyways because, technically, address filters still apply.
-		// The underlying AllAddrs call is effectivley a no-op.
+		// The underlying AllAddrs call is effectively a no-op.
 		curr := h.Addrs()
 		emitAddrChange(curr, lastAddrs)
 		lastAddrs = curr


Test patch:
diff --git a/p2p/host/autonat/svc_test.go b/p2p/host/autonat/svc_test.go
index 61e6038c..96836d1d 100644
--- a/p2p/host/autonat/svc_test.go
+++ b/p2p/host/autonat/svc_test.go
@@ -189,7 +189,7 @@ func TestAutoNATServiceRateLimitJitter(t *testing.T) {
 		svc.mx.Lock()
 		defer svc.mx.Unlock()
 		return svc.globalReqs == 0
-	}, dur*5/2, 10*time.Millisecond, "reset of rate limitter occured slower than expected")
+	}, dur*5/2, 10*time.Millisecond, "reset of rate limitter occurred slower than expected")
 }
 
 func TestAutoNATServiceStartup(t *testing.T) {
diff --git a/p2p/net/swarm/dial_test.go b/p2p/net/swarm/dial_test.go
index a614183b..3b139ef3 100644
--- a/p2p/net/swarm/dial_test.go
+++ b/p2p/net/swarm/dial_test.go
@@ -562,7 +562,7 @@ func TestDialSimultaneousJoin(t *testing.T) {
 			return
 		}
 
-		t.Logf("first dial succedded; conn: %+v", c)
+		t.Logf("first dial succeeded; conn: %+v", c)
 
 		connch <- c
 		errs <- nil
@@ -587,7 +587,7 @@ func TestDialSimultaneousJoin(t *testing.T) {
 			return
 		}
 
-		t.Logf("second dial succedded; conn: %+v", c)
+		t.Logf("second dial succeeded; conn: %+v", c)
 
 		connch <- c
 		errs <- nil
@@ -605,7 +605,7 @@ func TestDialSimultaneousJoin(t *testing.T) {
 			return
 		}
 
-		t.Logf("third dial succedded; conn: %+v", c)
+		t.Logf("third dial succeeded; conn: %+v", c)
 
 		connch <- c
 		errs <- nil