Skip to content

Commit

Permalink
chore: fix typos in comment (#2674)
Browse files Browse the repository at this point in the history
  • Loading branch information
bodhi-crypo authored Dec 29, 2023
1 parent d996df5 commit 317c9ff
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions internal/sha256/post_go1_21.go
Original file line number Diff line number Diff line change
@@ -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
Expand Down
4 changes: 2 additions & 2 deletions internal/sha256/pre_go1_21.go
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion p2p/http/libp2phttp.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down
6 changes: 3 additions & 3 deletions p2p/protocol/holepunch/svc.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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)
Expand Down

0 comments on commit 317c9ff

Please sign in to comment.