Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: fix typos in comment #2674

Merged
merged 1 commit into from
Dec 29, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading