Skip to content

Commit 290c469

Browse files
rscgopherbot
authored andcommitted
all: gofmt
Gofmt to update doc comments to the new formatting. For golang/go#51082. Change-Id: Iae68a9cd600060577271575e893ecb23bed1e509 Reviewed-on: https://go-review.googlesource.com/c/net/+/399599 Run-TryBot: Russ Cox <[email protected]> Reviewed-by: Ian Lance Taylor <[email protected]> Auto-Submit: Russ Cox <[email protected]> TryBot-Result: Gopher Robot <[email protected]>
1 parent aac1ed4 commit 290c469

File tree

26 files changed

+204
-197
lines changed

26 files changed

+204
-197
lines changed

bpf/doc.go

+2-4
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
// license that can be found in the LICENSE file.
44

55
/*
6-
76
Package bpf implements marshaling and unmarshaling of programs for the
87
Berkeley Packet Filter virtual machine, and provides a Go implementation
98
of the virtual machine.
@@ -21,7 +20,7 @@ access to kernel functions, and while conditional branches are
2120
allowed, they can only jump forwards, to guarantee that there are no
2221
infinite loops.
2322
24-
The virtual machine
23+
# The virtual machine
2524
2625
The BPF VM is an accumulator machine. Its main register, called
2726
register A, is an implicit source and destination in all arithmetic
@@ -50,7 +49,7 @@ to extensions, which are essentially calls to kernel utility
5049
functions. Currently, the only extensions supported by this package
5150
are the Linux packet filter extensions.
5251
53-
Examples
52+
# Examples
5453
5554
This packet filter selects all ARP packets.
5655
@@ -77,6 +76,5 @@ This packet filter captures a random 1% sample of traffic.
7776
// Ignore.
7877
bpf.RetConstant{Val: 0},
7978
})
80-
8179
*/
8280
package bpf // import "golang.org/x/net/bpf"

context/context.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,9 @@
2121
// explicitly to each function that needs it. The Context should be the first
2222
// parameter, typically named ctx:
2323
//
24-
// func DoSomething(ctx context.Context, arg Arg) error {
25-
// // ... use ctx ...
26-
// }
24+
// func DoSomething(ctx context.Context, arg Arg) error {
25+
// // ... use ctx ...
26+
// }
2727
//
2828
// Do not pass a nil Context, even if a function permits it. Pass context.TODO
2929
// if you are unsure about which Context to use.

context/go17.go

+5-5
Original file line numberDiff line numberDiff line change
@@ -54,11 +54,11 @@ func WithDeadline(parent Context, deadline time.Time) (Context, CancelFunc) {
5454
// Canceling this context releases resources associated with it, so code should
5555
// call cancel as soon as the operations running in this Context complete:
5656
//
57-
// func slowOperationWithTimeout(ctx context.Context) (Result, error) {
58-
// ctx, cancel := context.WithTimeout(ctx, 100*time.Millisecond)
59-
// defer cancel() // releases resources if slowOperation completes before timeout elapses
60-
// return slowOperation(ctx)
61-
// }
57+
// func slowOperationWithTimeout(ctx context.Context) (Result, error) {
58+
// ctx, cancel := context.WithTimeout(ctx, 100*time.Millisecond)
59+
// defer cancel() // releases resources if slowOperation completes before timeout elapses
60+
// return slowOperation(ctx)
61+
// }
6262
func WithTimeout(parent Context, timeout time.Duration) (Context, CancelFunc) {
6363
return WithDeadline(parent, time.Now().Add(timeout))
6464
}

context/pre_go17.go

+5-5
Original file line numberDiff line numberDiff line change
@@ -264,11 +264,11 @@ func (c *timerCtx) cancel(removeFromParent bool, err error) {
264264
// Canceling this context releases resources associated with it, so code should
265265
// call cancel as soon as the operations running in this Context complete:
266266
//
267-
// func slowOperationWithTimeout(ctx context.Context) (Result, error) {
268-
// ctx, cancel := context.WithTimeout(ctx, 100*time.Millisecond)
269-
// defer cancel() // releases resources if slowOperation completes before timeout elapses
270-
// return slowOperation(ctx)
271-
// }
267+
// func slowOperationWithTimeout(ctx context.Context) (Result, error) {
268+
// ctx, cancel := context.WithTimeout(ctx, 100*time.Millisecond)
269+
// defer cancel() // releases resources if slowOperation completes before timeout elapses
270+
// return slowOperation(ctx)
271+
// }
272272
func WithTimeout(parent Context, timeout time.Duration) (Context, CancelFunc) {
273273
return WithDeadline(parent, time.Now().Add(timeout))
274274
}

dns/dnsmessage/message.go

+1
Original file line numberDiff line numberDiff line change
@@ -1173,6 +1173,7 @@ func (m *Message) GoString() string {
11731173
// A Builder allows incrementally packing a DNS message.
11741174
//
11751175
// Example usage:
1176+
//
11761177
// buf := make([]byte, 2, 514)
11771178
// b := NewBuilder(buf, Header{...})
11781179
// b.EnableCompression()

http/httpguts/httplex.go

+29-25
Original file line numberDiff line numberDiff line change
@@ -173,13 +173,15 @@ func tokenEqual(t1, t2 string) bool {
173173

174174
// isLWS reports whether b is linear white space, according
175175
// to http://www.w3.org/Protocols/rfc2616/rfc2616-sec2.html#sec2.2
176-
// LWS = [CRLF] 1*( SP | HT )
176+
//
177+
// LWS = [CRLF] 1*( SP | HT )
177178
func isLWS(b byte) bool { return b == ' ' || b == '\t' }
178179

179180
// isCTL reports whether b is a control byte, according
180181
// to http://www.w3.org/Protocols/rfc2616/rfc2616-sec2.html#sec2.2
181-
// CTL = <any US-ASCII control character
182-
// (octets 0 - 31) and DEL (127)>
182+
//
183+
// CTL = <any US-ASCII control character
184+
// (octets 0 - 31) and DEL (127)>
183185
func isCTL(b byte) bool {
184186
const del = 0x7f // a CTL
185187
return b < ' ' || b == del
@@ -189,12 +191,13 @@ func isCTL(b byte) bool {
189191
// HTTP/2 imposes the additional restriction that uppercase ASCII
190192
// letters are not allowed.
191193
//
192-
// RFC 7230 says:
193-
// header-field = field-name ":" OWS field-value OWS
194-
// field-name = token
195-
// token = 1*tchar
196-
// tchar = "!" / "#" / "$" / "%" / "&" / "'" / "*" / "+" / "-" / "." /
197-
// "^" / "_" / "`" / "|" / "~" / DIGIT / ALPHA
194+
// RFC 7230 says:
195+
//
196+
// header-field = field-name ":" OWS field-value OWS
197+
// field-name = token
198+
// token = 1*tchar
199+
// tchar = "!" / "#" / "$" / "%" / "&" / "'" / "*" / "+" / "-" / "." /
200+
// "^" / "_" / "`" / "|" / "~" / DIGIT / ALPHA
198201
func ValidHeaderFieldName(v string) bool {
199202
if len(v) == 0 {
200203
return false
@@ -267,27 +270,28 @@ var validHostByte = [256]bool{
267270
// ValidHeaderFieldValue reports whether v is a valid "field-value" according to
268271
// http://www.w3.org/Protocols/rfc2616/rfc2616-sec4.html#sec4.2 :
269272
//
270-
// message-header = field-name ":" [ field-value ]
271-
// field-value = *( field-content | LWS )
272-
// field-content = <the OCTETs making up the field-value
273-
// and consisting of either *TEXT or combinations
274-
// of token, separators, and quoted-string>
273+
// message-header = field-name ":" [ field-value ]
274+
// field-value = *( field-content | LWS )
275+
// field-content = <the OCTETs making up the field-value
276+
// and consisting of either *TEXT or combinations
277+
// of token, separators, and quoted-string>
275278
//
276279
// http://www.w3.org/Protocols/rfc2616/rfc2616-sec2.html#sec2.2 :
277280
//
278-
// TEXT = <any OCTET except CTLs,
279-
// but including LWS>
280-
// LWS = [CRLF] 1*( SP | HT )
281-
// CTL = <any US-ASCII control character
282-
// (octets 0 - 31) and DEL (127)>
281+
// TEXT = <any OCTET except CTLs,
282+
// but including LWS>
283+
// LWS = [CRLF] 1*( SP | HT )
284+
// CTL = <any US-ASCII control character
285+
// (octets 0 - 31) and DEL (127)>
283286
//
284287
// RFC 7230 says:
285-
// field-value = *( field-content / obs-fold )
286-
// obj-fold = N/A to http2, and deprecated
287-
// field-content = field-vchar [ 1*( SP / HTAB ) field-vchar ]
288-
// field-vchar = VCHAR / obs-text
289-
// obs-text = %x80-FF
290-
// VCHAR = "any visible [USASCII] character"
288+
//
289+
// field-value = *( field-content / obs-fold )
290+
// obj-fold = N/A to http2, and deprecated
291+
// field-content = field-vchar [ 1*( SP / HTAB ) field-vchar ]
292+
// field-vchar = VCHAR / obs-text
293+
// obs-text = %x80-FF
294+
// VCHAR = "any visible [USASCII] character"
291295
//
292296
// http2 further says: "Similarly, HTTP/2 allows header field values
293297
// that are not valid. While most of the values that can be encoded

http2/h2i/h2i.go

+6-5
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,15 @@
99
The h2i command is an interactive HTTP/2 console.
1010
1111
Usage:
12-
$ h2i [flags] <hostname>
12+
13+
$ h2i [flags] <hostname>
1314
1415
Interactive commands in the console: (all parts case-insensitive)
1516
16-
ping [data]
17-
settings ack
18-
settings FOO=n BAR=z
19-
headers (open a new stream by typing HTTP/1.1)
17+
ping [data]
18+
settings ack
19+
settings FOO=n BAR=z
20+
headers (open a new stream by typing HTTP/1.1)
2021
*/
2122
package main
2223

http2/http2.go

+7-7
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
// See https://http2.github.io/ for more information on HTTP/2.
1414
//
1515
// See https://http2.golang.org/ for a test server running this code.
16-
//
1716
package http2 // import "golang.org/x/net/http2"
1817

1918
import (
@@ -176,10 +175,11 @@ func (s SettingID) String() string {
176175
// name (key). See httpguts.ValidHeaderName for the base rules.
177176
//
178177
// Further, http2 says:
179-
// "Just as in HTTP/1.x, header field names are strings of ASCII
180-
// characters that are compared in a case-insensitive
181-
// fashion. However, header field names MUST be converted to
182-
// lowercase prior to their encoding in HTTP/2. "
178+
//
179+
// "Just as in HTTP/1.x, header field names are strings of ASCII
180+
// characters that are compared in a case-insensitive
181+
// fashion. However, header field names MUST be converted to
182+
// lowercase prior to their encoding in HTTP/2. "
183183
func validWireHeaderFieldName(v string) bool {
184184
if len(v) == 0 {
185185
return false
@@ -365,8 +365,8 @@ func (s *sorter) SortStrings(ss []string) {
365365
// validPseudoPath reports whether v is a valid :path pseudo-header
366366
// value. It must be either:
367367
//
368-
// *) a non-empty string starting with '/'
369-
// *) the string '*', for OPTIONS requests.
368+
// - a non-empty string starting with '/'
369+
// - the string '*', for OPTIONS requests.
370370
//
371371
// For now this is only used a quick check for deciding when to clean
372372
// up Opaque URLs before sending requests from the Transport.

http2/server.go

+3-2
Original file line numberDiff line numberDiff line change
@@ -2546,8 +2546,9 @@ func (rws *responseWriterState) writeChunk(p []byte) (n int, err error) {
25462546
// prior to the headers being written. If the set of trailers is fixed
25472547
// or known before the header is written, the normal Go trailers mechanism
25482548
// is preferred:
2549-
// https://golang.org/pkg/net/http/#ResponseWriter
2550-
// https://golang.org/pkg/net/http/#example_ResponseWriter_trailers
2549+
//
2550+
// https://golang.org/pkg/net/http/#ResponseWriter
2551+
// https://golang.org/pkg/net/http/#example_ResponseWriter_trailers
25512552
const TrailerPrefix = "Trailer:"
25522553

25532554
// promoteUndeclaredTrailers permits http.Handlers to set trailers

http2/server_test.go

+3-2
Original file line numberDiff line numberDiff line change
@@ -2702,8 +2702,9 @@ func readBodyHandler(t *testing.T, want string) func(w http.ResponseWriter, r *h
27022702
}
27032703

27042704
// TestServerWithCurl currently fails, hence the LenientCipherSuites test. See:
2705-
// https://github.com/tatsuhiro-t/nghttp2/issues/140 &
2706-
// http://sourceforge.net/p/curl/bugs/1472/
2705+
//
2706+
// https://github.com/tatsuhiro-t/nghttp2/issues/140 &
2707+
// http://sourceforge.net/p/curl/bugs/1472/
27072708
func TestServerWithCurl(t *testing.T) { testServerWithCurl(t, false) }
27082709
func TestServerWithCurl_LenientCipherSuites(t *testing.T) { testServerWithCurl(t, true) }
27092710

http2/transport_test.go

+6-3
Original file line numberDiff line numberDiff line change
@@ -1155,7 +1155,9 @@ const (
11551155
)
11561156

11571157
// Test all 36 combinations of response frame orders:
1158-
// (3 ways of 100-continue) * (2 ways of headers) * (2 ways of data) * (3 ways of trailers):func TestTransportResponsePattern_00f0(t *testing.T) { testTransportResponsePattern(h0, h1, false, h0) }
1158+
//
1159+
// (3 ways of 100-continue) * (2 ways of headers) * (2 ways of data) * (3 ways of trailers):func TestTransportResponsePattern_00f0(t *testing.T) { testTransportResponsePattern(h0, h1, false, h0) }
1160+
//
11591161
// Generated by http://play.golang.org/p/SScqYKJYXd
11601162
func TestTransportResPattern_c0h1d0t0(t *testing.T) { testTransportResPattern(t, f0, f1, d0, f0) }
11611163
func TestTransportResPattern_c0h1d0t1(t *testing.T) { testTransportResPattern(t, f0, f1, d0, f1) }
@@ -1575,8 +1577,9 @@ func testInvalidTrailer(t *testing.T, trailers headerType, wantErr error, writeT
15751577
}
15761578

15771579
// headerListSize returns the HTTP2 header list size of h.
1578-
// http://httpwg.org/specs/rfc7540.html#SETTINGS_MAX_HEADER_LIST_SIZE
1579-
// http://httpwg.org/specs/rfc7540.html#MaxHeaderBlock
1580+
//
1581+
// http://httpwg.org/specs/rfc7540.html#SETTINGS_MAX_HEADER_LIST_SIZE
1582+
// http://httpwg.org/specs/rfc7540.html#MaxHeaderBlock
15801583
func headerListSize(h http.Header) (size uint32) {
15811584
for k, vv := range h {
15821585
for _, v := range vv {

icmp/listen_posix.go

+2
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ const sysIP_STRIPHDR = 0x17 // for now only darwin supports this option
2929
// Currently only Darwin and Linux support this.
3030
//
3131
// Examples:
32+
//
3233
// ListenPacket("udp4", "192.168.0.1")
3334
// ListenPacket("udp4", "0.0.0.0")
3435
// ListenPacket("udp6", "fe80::1%en0")
@@ -38,6 +39,7 @@ const sysIP_STRIPHDR = 0x17 // for now only darwin supports this option
3839
// followed by a colon and an ICMP protocol number or name.
3940
//
4041
// Examples:
42+
//
4143
// ListenPacket("ip4:icmp", "192.168.0.1")
4244
// ListenPacket("ip4:1", "0.0.0.0")
4345
// ListenPacket("ip6:ipv6-icmp", "fe80::1%en0")

icmp/listen_stub.go

+2
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ package icmp
1616
// Currently only Darwin and Linux support this.
1717
//
1818
// Examples:
19+
//
1920
// ListenPacket("udp4", "192.168.0.1")
2021
// ListenPacket("udp4", "0.0.0.0")
2122
// ListenPacket("udp6", "fe80::1%en0")
@@ -25,6 +26,7 @@ package icmp
2526
// followed by a colon and an ICMP protocol number or name.
2627
//
2728
// Examples:
29+
//
2830
// ListenPacket("ip4:icmp", "192.168.0.1")
2931
// ListenPacket("ip4:1", "0.0.0.0")
3032
// ListenPacket("ip6:ipv6-icmp", "fe80::1%en0")

idna/trieval.go

+17-17
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

internal/socket/zsys_linux_ppc.go

+16-16
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)