diff --git a/internal/sha256/post_go1_21.go b/internal/sha256/post_go1_21.go index 98c14b609a..96d61ccc0d 100644 --- a/internal/sha256/post_go1_21.go +++ b/internal/sha256/post_go1_21.go @@ -1,8 +1,8 @@ //go:build go1.21 // This package use build tags to select between github.com/minio/sha256-simd -// for go1.20 and bellow and crypto/sha256 for go1.21 and above. -// This is used because a fast SHANI implementation of sha256 is only avaiable +// for go1.20 and below and crypto/sha256 for go1.21 and above. +// This is used because a fast SHANI implementation of sha256 is only available // in the std for go1.21 and above. See https://go.dev/issue/50543. // TODO: Once go1.22 releases remove this package and replace all uses // with crypto/sha256 because the two supported version of go will have the fast diff --git a/internal/sha256/pre_go1_21.go b/internal/sha256/pre_go1_21.go index db05733338..91046b9ec0 100644 --- a/internal/sha256/pre_go1_21.go +++ b/internal/sha256/pre_go1_21.go @@ -1,8 +1,8 @@ //go:build !go1.21 // This package use build tags to select between github.com/minio/sha256-simd -// for go1.20 and bellow and crypto/sha256 for go1.21 and above. -// This is used because a fast SHANI implementation of sha256 is only avaiable +// for go1.20 and below and crypto/sha256 for go1.21 and above. +// This is used because a fast SHANI implementation of sha256 is only available // in the std for go1.21 and above. See https://go.dev/issue/50543. // TODO: Once go1.22 releases remove this package and replace all uses // with crypto/sha256 because the two supported version of go will have the fast diff --git a/p2p/http/libp2phttp.go b/p2p/http/libp2phttp.go index 87f8f9a38a..fbd8a64f4e 100644 --- a/p2p/http/libp2phttp.go +++ b/p2p/http/libp2phttp.go @@ -48,7 +48,7 @@ type WellKnownHandler struct { wellKnownCache []byte } -// streamHostListen retuns a net.Listener that listens on libp2p streams for HTTP/1.1 messages. +// streamHostListen returns a net.Listener that listens on libp2p streams for HTTP/1.1 messages. func streamHostListen(streamHost host.Host) (net.Listener, error) { return gostream.Listen(streamHost, ProtocolIDForMultistreamSelect) } diff --git a/p2p/protocol/holepunch/svc.go b/p2p/protocol/holepunch/svc.go index 47bf434fb1..70fd0ef55b 100644 --- a/p2p/protocol/holepunch/svc.go +++ b/p2p/protocol/holepunch/svc.go @@ -196,7 +196,7 @@ func (s *Service) incomingHolePunch(str network.Stream) (rtt time.Duration, remo str.SetDeadline(time.Now().Add(StreamTimeout)) if err := rd.ReadMsg(msg); err != nil { - return 0, nil, nil, fmt.Errorf("failed to read message from initator: %w", err) + return 0, nil, nil, fmt.Errorf("failed to read message from initiator: %w", err) } if t := msg.GetType(); t != pb.HolePunch_CONNECT { return 0, nil, nil, fmt.Errorf("expected CONNECT message from initiator but got %d", t) @@ -218,13 +218,13 @@ func (s *Service) incomingHolePunch(str network.Stream) (rtt time.Duration, remo msg.ObsAddrs = addrsToBytes(ownAddrs) tstart := time.Now() if err := wr.WriteMsg(msg); err != nil { - return 0, nil, nil, fmt.Errorf("failed to write CONNECT message to initator: %w", err) + return 0, nil, nil, fmt.Errorf("failed to write CONNECT message to initiator: %w", err) } // Read SYNC message msg.Reset() if err := rd.ReadMsg(msg); err != nil { - return 0, nil, nil, fmt.Errorf("failed to read message from initator: %w", err) + return 0, nil, nil, fmt.Errorf("failed to read message from initiator: %w", err) } if t := msg.GetType(); t != pb.HolePunch_SYNC { return 0, nil, nil, fmt.Errorf("expected SYNC message from initiator but got %d", t)