Browse Source

icmp: update docs

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>
Mikio Hara 7 years ago
parent
commit
8d04b09ac7
4 changed files with 13 additions and 7 deletions
  1. 3 2
      icmp/endpoint.go
  2. 4 2
      icmp/extension.go
  3. 2 1
      icmp/message.go
  4. 4 2
      icmp/messagebody.go

+ 3 - 2
icmp/endpoint.go

@@ -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

+ 4 - 2
icmp/extension.go

@@ -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)
 }
 

+ 2 - 1
icmp/message.go

@@ -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

+ 4 - 2
icmp/messagebody.go

@@ -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)
 }