Skip to content

Commit 2124140

Browse files
cuishuanggopherbot
authored andcommitted
all: make function and struct comments match the names
Change-Id: I1f4a4c8daec5ac7d26f1d4df76726af664adcb36 Reviewed-on: https://go-review.googlesource.com/c/net/+/639576 Reviewed-by: Jorropo <jorropo.pgm@gmail.com> Auto-Submit: Damien Neil <dneil@google.com> Commit-Queue: Ian Lance Taylor <iant@google.com> Reviewed-by: Damien Neil <dneil@google.com> Auto-Submit: Ian Lance Taylor <iant@google.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Auto-Submit: Jorropo <jorropo.pgm@gmail.com> Reviewed-by: Ian Lance Taylor <iant@google.com>
1 parent e9d95ba commit 2124140

17 files changed

+21
-21
lines changed

http2/config.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ func configFromServer(h1 *http.Server, h2 *Server) http2Config {
6060
return conf
6161
}
6262

63-
// configFromServer merges configuration settings from h2 and h2.t1.HTTP2
63+
// configFromTransport merges configuration settings from h2 and h2.t1.HTTP2
6464
// (the net/http Transport).
6565
func configFromTransport(h2 *Transport) http2Config {
6666
conf := http2Config{

http2/config_go124.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ func fillNetHTTPServerConfig(conf *http2Config, srv *http.Server) {
1313
fillNetHTTPConfig(conf, srv.HTTP2)
1414
}
1515

16-
// fillNetHTTPServerConfig sets fields in conf from tr.HTTP2.
16+
// fillNetHTTPTransportConfig sets fields in conf from tr.HTTP2.
1717
func fillNetHTTPTransportConfig(conf *http2Config, tr *http.Transport) {
1818
fillNetHTTPConfig(conf, tr.HTTP2)
1919
}

http2/gate_test.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ func newGate() gate {
2424
return g
2525
}
2626

27-
// newLocked gate returns a new, locked gate.
27+
// newLockedGate returns a new, locked gate.
2828
func newLockedGate() gate {
2929
return gate{
3030
set: make(chan struct{}, 1),
@@ -78,7 +78,7 @@ func (g *gate) unlock(set bool) {
7878
}
7979
}
8080

81-
// unlock sets the condition to the result of f and releases the gate.
81+
// unlockFunc sets the condition to the result of f and releases the gate.
8282
// Useful in defers.
8383
func (g *gate) unlockFunc(f func() bool) {
8484
g.unlock(f())

http2/netconn_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ func (c *synctestNetConn) Write(b []byte) (n int, err error) {
7676
return c.rem.write(b)
7777
}
7878

79-
// IsClosed reports whether the peer has closed its end of the connection.
79+
// IsClosedByPeer reports whether the peer has closed its end of the connection.
8080
func (c *synctestNetConn) IsClosedByPeer() bool {
8181
if c.autoWait {
8282
c.group.Wait()

http2/server_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -4327,7 +4327,7 @@ func TestCanonicalHeaderCacheGrowth(t *testing.T) {
43274327
}
43284328
}
43294329

4330-
// TestServerWriteDoesNotRetainBufferAfterStreamClose checks for access to
4330+
// TestServerWriteDoesNotRetainBufferAfterReturn checks for access to
43314331
// the slice passed to ResponseWriter.Write after Write returns.
43324332
//
43334333
// Terminating the request stream on the client causes Write to return.

quic/conn_close.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ func (c *Conn) sendOK(now time.Time) bool {
178178
}
179179
}
180180

181-
// sendConnectionClose reports that the conn has sent a CONNECTION_CLOSE to the peer.
181+
// sentConnectionClose reports that the conn has sent a CONNECTION_CLOSE to the peer.
182182
func (c *Conn) sentConnectionClose(now time.Time) {
183183
switch c.lifetime.state {
184184
case connStatePeerClosed:

quic/conn_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -436,7 +436,7 @@ func (tc *testConn) write(d *testDatagram) {
436436
tc.endpoint.writeDatagram(d)
437437
}
438438

439-
// writeFrame sends the Conn a datagram containing the given frames.
439+
// writeFrames sends the Conn a datagram containing the given frames.
440440
func (tc *testConn) writeFrames(ptype packetType, frames ...debugFrame) {
441441
tc.t.Helper()
442442
space := spaceForPacketType(ptype)

quic/endpoint.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -448,7 +448,7 @@ func (m *connsMap) updateConnIDs(f func(*connsMap)) {
448448
m.updateNeeded.Store(true)
449449
}
450450

451-
// applyConnIDUpdates is called by the datagram receive loop to update its connection ID map.
451+
// applyUpdates is called by the datagram receive loop to update its connection ID map.
452452
func (m *connsMap) applyUpdates() {
453453
m.updateMu.Lock()
454454
defer m.updateMu.Unlock()

quic/gate.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ func newGate() gate {
2727
return g
2828
}
2929

30-
// newLocked gate returns a new, locked gate.
30+
// newLockedGate returns a new, locked gate.
3131
func newLockedGate() gate {
3232
return gate{
3333
set: make(chan struct{}, 1),
@@ -84,7 +84,7 @@ func (g *gate) unlock(set bool) {
8484
}
8585
}
8686

87-
// unlock sets the condition to the result of f and releases the gate.
87+
// unlockFunc sets the condition to the result of f and releases the gate.
8888
// Useful in defers.
8989
func (g *gate) unlockFunc(f func() bool) {
9090
g.unlock(f())

quic/packet_protection.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -519,7 +519,7 @@ func hashForSuite(suite uint16) (h crypto.Hash, keySize int) {
519519
}
520520
}
521521

522-
// hdkfExpandLabel implements HKDF-Expand-Label from RFC 8446, Section 7.1.
522+
// hkdfExpandLabel implements HKDF-Expand-Label from RFC 8446, Section 7.1.
523523
//
524524
// Copied from crypto/tls/key_schedule.go.
525525
func hkdfExpandLabel(hash func() hash.Hash, secret []byte, label string, context []byte, length int) []byte {

quic/packet_writer.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ func (w *packetWriter) datagram() []byte {
4747
return w.b
4848
}
4949

50-
// packet returns the size of the current packet.
50+
// packetLen returns the size of the current packet.
5151
func (w *packetWriter) packetLen() int {
5252
return len(w.b[w.pktOff:]) + aeadOverhead
5353
}
@@ -527,7 +527,7 @@ func (w *packetWriter) appendConnectionCloseTransportFrame(code transportError,
527527
return true
528528
}
529529

530-
// appendConnectionCloseTransportFrame appends a CONNECTION_CLOSE frame
530+
// appendConnectionCloseApplicationFrame appends a CONNECTION_CLOSE frame
531531
// carrying an application protocol error code.
532532
func (w *packetWriter) appendConnectionCloseApplicationFrame(code uint64, reason string) (added bool) {
533533
if w.avail() < 1+sizeVarint(code)+sizeVarint(uint64(len(reason)))+len(reason) {

quic/qlog/json_writer.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ func (w *jsonWriter) writeAttr(a slog.Attr) {
5858
w.writeValue(a.Value)
5959
}
6060

61-
// writeAttr writes a []slog.Attr as an object field.
61+
// writeAttrsField writes a []slog.Attr as an object field.
6262
func (w *jsonWriter) writeAttrsField(name string, attrs []slog.Attr) {
6363
w.writeName(name)
6464
w.writeAttrs(attrs)
@@ -113,7 +113,7 @@ func (w *jsonWriter) writeObject(f func()) {
113113
w.buf.WriteByte('}')
114114
}
115115

116-
// writeObject writes an object-valued object field.
116+
// writeObjectField writes an object-valued object field.
117117
// The function f is called to write the contents.
118118
func (w *jsonWriter) writeObjectField(name string, f func()) {
119119
w.writeName(name)

quic/rtt.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ func (r *rttState) establishPersistentCongestion() {
3737
r.minRTT = r.latestRTT
3838
}
3939

40-
// updateRTTSample is called when we generate a new RTT sample.
40+
// updateSample is called when we generate a new RTT sample.
4141
// https://www.rfc-editor.org/rfc/rfc9002.html#section-5
4242
func (r *rttState) updateSample(now time.Time, handshakeConfirmed bool, spaceID numberSpace, latestRTT, ackDelay, maxAckDelay time.Duration) {
4343
r.latestRTT = latestRTT

quic/sent_val.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ func (s sentVal) isSet() bool { return s != 0 }
3737
// shouldSend reports whether the value is set and has not been sent to the peer.
3838
func (s sentVal) shouldSend() bool { return s.state() == sentValUnsent }
3939

40-
// shouldSend reports whether the value needs to be sent to the peer.
40+
// shouldSendPTO reports whether the value needs to be sent to the peer.
4141
// The value needs to be sent if it is set and has not been sent.
4242
// If pto is true, indicating that we are sending a PTO probe, the value
4343
// should also be sent if it is set and has not been acknowledged.

quic/stream.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -418,7 +418,7 @@ func (s *Stream) Write(b []byte) (n int, err error) {
418418
return n, nil
419419
}
420420

421-
// WriteBytes writes a single byte to the stream.
421+
// WriteByte writes a single byte to the stream.
422422
func (s *Stream) WriteByte(c byte) error {
423423
if s.outbufoff < len(s.outbuf) {
424424
s.outbuf[s.outbufoff] = c

quic/wire.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ func consumeVarint(b []byte) (v uint64, n int) {
4444
return 0, -1
4545
}
4646

47-
// consumeVarint64 parses a variable-length integer as an int64.
47+
// consumeVarintInt64 parses a variable-length integer as an int64.
4848
func consumeVarintInt64(b []byte) (v int64, n int) {
4949
u, n := consumeVarint(b)
5050
// QUIC varints are 62-bits large, so this conversion can never overflow.

route/sys_netbsd.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ func (m *RouteMessage) Sys() []Sys {
2525
}
2626
}
2727

28-
// RouteMetrics represents route metrics.
28+
// InterfaceMetrics represents route metrics.
2929
type InterfaceMetrics struct {
3030
Type int // interface type
3131
MTU int // maximum transmission unit

0 commit comments

Comments
 (0)