Skip to content

Commit

Permalink
icmp: update docs
Browse files Browse the repository at this point in the history
Makes parameter names not start in capitals.

Change-Id: I1861da0cbaff304b251f9540613cff8dc7beafd6
Reviewed-on: https://go-review.googlesource.com/126638
Reviewed-by: Matt Layher <mdlayher@gmail.com>
  • Loading branch information
cixtor committed Jul 30, 2018
1 parent 17b7cf4 commit 8d04b09
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 7 deletions.
5 changes: 3 additions & 2 deletions icmp/endpoint.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,9 @@ func (c *PacketConn) ReadFrom(b []byte) (int, net.Addr, error) {
}

// WriteTo writes the ICMP message b to dst.
// Dst must be net.UDPAddr when c is a non-privileged
// datagram-oriented ICMP endpoint. Otherwise it must be net.IPAddr.
// The provided dst must be net.UDPAddr when c is a non-privileged
// datagram-oriented ICMP endpoint.
// Otherwise it must be net.IPAddr.
func (c *PacketConn) WriteTo(b []byte, dst net.Addr) (int, error) {
if !c.ok() {
return 0, errInvalidConn
Expand Down
6 changes: 4 additions & 2 deletions icmp/extension.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,13 @@ import (
// An Extension represents an ICMP extension.
type Extension interface {
// Len returns the length of ICMP extension.
// Proto must be either the ICMPv4 or ICMPv6 protocol number.
// The provided proto must be either the ICMPv4 or ICMPv6
// protocol number.
Len(proto int) int

// Marshal returns the binary encoding of ICMP extension.
// Proto must be either the ICMPv4 or ICMPv6 protocol number.
// The provided proto must be either the ICMPv4 or ICMPv6
// protocol number.
Marshal(proto int) ([]byte, error)
}

Expand Down
3 changes: 2 additions & 1 deletion icmp/message.go
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,8 @@ var parseFns = map[Type]func(int, Type, []byte) (MessageBody, error){
}

// ParseMessage parses b as an ICMP message.
// Proto must be either the ICMPv4 or ICMPv6 protocol number.
// The provided proto must be either the ICMPv4 or ICMPv6 protocol
// number.
func ParseMessage(proto int, b []byte) (*Message, error) {
if len(b) < 4 {
return nil, errMessageTooShort
Expand Down
6 changes: 4 additions & 2 deletions icmp/messagebody.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,13 @@ package icmp
// A MessageBody represents an ICMP message body.
type MessageBody interface {
// Len returns the length of ICMP message body.
// Proto must be either the ICMPv4 or ICMPv6 protocol number.
// The provided proto must be either the ICMPv4 or ICMPv6
// protocol number.
Len(proto int) int

// Marshal returns the binary encoding of ICMP message body.
// Proto must be either the ICMPv4 or ICMPv6 protocol number.
// The provided proto must be either the ICMPv4 or ICMPv6
// protocol number.
Marshal(proto int) ([]byte, error)
}

Expand Down

0 comments on commit 8d04b09

Please sign in to comment.