From a70addd3b31ccb685f48867e24c6c2b4dc364a11 Mon Sep 17 00:00:00 2001 From: cuishuang Date: Thu, 4 Dec 2025 11:39:53 +0800 Subject: [PATCH] all: fix some comment issues Change-Id: I5dec35b1432705b3a52859c38e758220282226af Reviewed-on: https://go-review.googlesource.com/c/go/+/726700 LUCI-TryBot-Result: Go LUCI Reviewed-by: Sean Liao Auto-Submit: Dmitri Shuralyov Reviewed-by: Cherry Mui Reviewed-by: Dmitri Shuralyov --- src/crypto/md5/gen.go | 2 +- src/crypto/tls/ticket.go | 2 +- src/encoding/gob/decgen.go | 4 ++-- src/go/ast/walk.go | 2 +- src/net/http/cookie.go | 3 ++- src/runtime/mgc.go | 2 +- 6 files changed, 8 insertions(+), 7 deletions(-) diff --git a/src/crypto/md5/gen.go b/src/crypto/md5/gen.go index bcbc70367d..cad9e91405 100644 --- a/src/crypto/md5/gen.go +++ b/src/crypto/md5/gen.go @@ -153,7 +153,7 @@ var data = Data{ 0x8d2a4c8a, }, Table3: []uint32{ - // round3 + // round 3 0xfffa3942, 0x8771f681, 0x6d9d6122, diff --git a/src/crypto/tls/ticket.go b/src/crypto/tls/ticket.go index c56898c6f7..11f7efde85 100644 --- a/src/crypto/tls/ticket.go +++ b/src/crypto/tls/ticket.go @@ -81,7 +81,7 @@ type SessionState struct { version uint16 isClient bool cipherSuite uint16 - // createdAt is the generation time of the secret on the sever (which for + // createdAt is the generation time of the secret on the server (which for // TLS 1.0–1.2 might be earlier than the current session) and the time at // which the ticket was received on the client. createdAt uint64 // seconds since UNIX epoch diff --git a/src/encoding/gob/decgen.go b/src/encoding/gob/decgen.go index 420c86207c..95d84b6762 100644 --- a/src/encoding/gob/decgen.go +++ b/src/encoding/gob/decgen.go @@ -4,8 +4,8 @@ //go:build ignore -// encgen writes the helper functions for encoding. Intended to be -// used with go generate; see the invocation in encode.go. +// decgen writes the helper functions for decoding. Intended to be +// used with go generate; see the invocation in decode.go. // TODO: We could do more by being unsafe. Add a -unsafe flag? diff --git a/src/go/ast/walk.go b/src/go/ast/walk.go index 24cdc60d73..9328bccae4 100644 --- a/src/go/ast/walk.go +++ b/src/go/ast/walk.go @@ -370,7 +370,7 @@ func (f inspector) Visit(node Node) Visitor { // call of f(nil). // // In many cases it may be more convenient to use [Preorder], which -// returns an iterator over the sqeuence of nodes, or [PreorderStack], +// returns an iterator over the sequence of nodes, or [PreorderStack], // which (like [Inspect]) provides control over descent into subtrees, // but additionally reports the stack of enclosing nodes. func Inspect(node Node, f func(Node) bool) { diff --git a/src/net/http/cookie.go b/src/net/http/cookie.go index f74bc1043c..4cc9ae3152 100644 --- a/src/net/http/cookie.go +++ b/src/net/http/cookie.go @@ -443,7 +443,8 @@ func isCookieDomainName(s string) bool { } if s[0] == '.' { - // A cookie a domain attribute may start with a leading dot. + // A cookie domain attribute may start with a leading dot. + // Per RFC 6265 section 5.2.3, a leading dot is ignored. s = s[1:] } last := byte('.') diff --git a/src/runtime/mgc.go b/src/runtime/mgc.go index 32cd8cb0e8..a3bed4b3eb 100644 --- a/src/runtime/mgc.go +++ b/src/runtime/mgc.go @@ -5,7 +5,7 @@ // Garbage collector (GC). // // The GC runs concurrently with mutator threads, is type accurate (aka precise), allows multiple -// GC thread to run in parallel. It is a concurrent mark and sweep that uses a write barrier. It is +// GC threads to run in parallel. It is a concurrent mark and sweep that uses a write barrier. It is // non-generational and non-compacting. Allocation is done using size segregated per P allocation // areas to minimize fragmentation while eliminating locks in the common case. // -- 2.52.0