diff --git a/src/cmd/compile/internal/bitvec/bv.go b/src/cmd/compile/internal/bitvec/bv.go index d3133dcd2dc..9214aa6cd05 100644 --- a/src/cmd/compile/internal/bitvec/bv.go +++ b/src/cmd/compile/internal/bitvec/bv.go @@ -93,7 +93,7 @@ func (bv BitVec) Unset(i int32) { bv.B[i/wordBits] &^= mask } -// bvnext returns the smallest index >= i for which bvget(bv, i) == 1. +// Next returns the smallest index >= i for which bvget(bv, i) == 1. // If there is no such index, bvnext returns -1. func (bv BitVec) Next(i int32) int32 { if i >= bv.N { diff --git a/src/cmd/compile/internal/ir/expr.go b/src/cmd/compile/internal/ir/expr.go index 037957b676a..7a75ff40f2d 100644 --- a/src/cmd/compile/internal/ir/expr.go +++ b/src/cmd/compile/internal/ir/expr.go @@ -617,7 +617,7 @@ func (o Op) IsSlice3() bool { return false } -// A SliceHeader expression constructs a slice header from its parts. +// A SliceHeaderExpr constructs a slice header from its parts. type SliceHeaderExpr struct { miniExpr Ptr Node @@ -665,7 +665,7 @@ func NewStarExpr(pos src.XPos, x Node) *StarExpr { func (n *StarExpr) Implicit() bool { return n.flags&miniExprImplicit != 0 } func (n *StarExpr) SetImplicit(b bool) { n.flags.set(miniExprImplicit, b) } -// A TypeAssertionExpr is a selector expression X.(Type). +// A TypeAssertExpr is a selector expression X.(Type). // Before type-checking, the type is Ntype. type TypeAssertExpr struct { miniExpr diff --git a/src/cmd/compile/internal/s390x/ggen.go b/src/cmd/compile/internal/s390x/ggen.go index 70e40312248..c4f88e78262 100644 --- a/src/cmd/compile/internal/s390x/ggen.go +++ b/src/cmd/compile/internal/s390x/ggen.go @@ -11,7 +11,7 @@ import ( "cmd/internal/obj/s390x" ) -// clearLoopCutOff is the (somewhat arbitrary) value above which it is better +// clearLoopCutoff is the (somewhat arbitrary) value above which it is better // to have a loop of clear instructions (e.g. XCs) rather than just generating // multiple instructions (i.e. loop unrolling). // Must be between 256 and 4096. diff --git a/src/cmd/compile/internal/types/type.go b/src/cmd/compile/internal/types/type.go index 6a3e9b512e7..da859290f7a 100644 --- a/src/cmd/compile/internal/types/type.go +++ b/src/cmd/compile/internal/types/type.go @@ -328,7 +328,7 @@ func (t *Type) funcType() *Func { return t.extra.(*Func) } -// StructType contains Type fields specific to struct types. +// Struct contains Type fields specific to struct types. type Struct struct { fields fields diff --git a/src/cmd/compile/internal/types2/object.go b/src/cmd/compile/internal/types2/object.go index 463ed30308d..096b5653e53 100644 --- a/src/cmd/compile/internal/types2/object.go +++ b/src/cmd/compile/internal/types2/object.go @@ -328,7 +328,7 @@ func (obj *TypeName) IsAlias() bool { } } -// A Variable represents a declared variable (including function parameters and results, and struct fields). +// A Var represents a declared variable (including function parameters and results, and struct fields). type Var struct { object origin *Var // if non-nil, the Var from which this one was instantiated diff --git a/src/cmd/go/internal/vet/vet.go b/src/cmd/go/internal/vet/vet.go index e274348bd6a..f9579d498f5 100644 --- a/src/cmd/go/internal/vet/vet.go +++ b/src/cmd/go/internal/vet/vet.go @@ -396,7 +396,7 @@ type jsonError struct { Err string `json:"error"` } -// A TextEdit describes the replacement of a portion of a file. +// A jsonTextEdit describes the replacement of a portion of a file. // Start and End are zero-based half-open indices into the original byte // sequence of the file, and New is the new text. type jsonTextEdit struct { @@ -424,7 +424,7 @@ type jsonDiagnostic struct { Related []jsonRelatedInformation `json:"related,omitempty"` } -// A jsonRelated describes a secondary position and message related to +// A jsonRelatedInformation describes a secondary position and message related to // a primary diagnostic. type jsonRelatedInformation struct { Posn string `json:"posn"` // e.g. "file.go:line:column" diff --git a/src/cmd/internal/obj/x86/evex.go b/src/cmd/internal/obj/x86/evex.go index aa93cd8819a..12fe0347046 100644 --- a/src/cmd/internal/obj/x86/evex.go +++ b/src/cmd/internal/obj/x86/evex.go @@ -165,7 +165,7 @@ func evexZcase(zcase uint8) bool { return zcase > Zevex_first && zcase < Zevex_last } -// evexSuffixBits carries instruction EVEX suffix set flags. +// evexSuffix carries instruction EVEX suffix set flags. // // Examples: // diff --git a/src/cmd/internal/objfile/goobj.go b/src/cmd/internal/objfile/goobj.go index e8b8b522516..c428e29c9b1 100644 --- a/src/cmd/internal/objfile/goobj.go +++ b/src/cmd/internal/objfile/goobj.go @@ -227,7 +227,7 @@ func (f *goobjFile) pcln() (textStart uint64, symtab, pclntab []byte, err error) return 0, nil, nil, fmt.Errorf("pcln not available in go object file") } -// Find returns the file name, line, and function data for the given pc. +// PCToLine returns the file name, line, and function data for the given pc. // Returns "",0,nil if unknown. // This function implements the Liner interface in preference to pcln() above. func (f *goobjFile) PCToLine(pc uint64) (string, int, *gosym.Func) { diff --git a/src/cmd/link/internal/loader/symbolbuilder.go b/src/cmd/link/internal/loader/symbolbuilder.go index 35749f9ea93..d385dec94a1 100644 --- a/src/cmd/link/internal/loader/symbolbuilder.go +++ b/src/cmd/link/internal/loader/symbolbuilder.go @@ -139,7 +139,7 @@ func (sb *SymbolBuilder) SetRelocAdd(i int, a int64) { sb.relocs[i].SetAdd(a) } -// SetRelocAdd sets the size of the 'i'-th relocation on this sym to 'sz' +// SetRelocSiz sets the size of the 'i'-th relocation on this sym to 'sz' func (sb *SymbolBuilder) SetRelocSiz(i int, sz uint8) { sb.relocs[i].SetSiz(sz) } diff --git a/src/crypto/internal/fips140/rsa/pkcs1v22.go b/src/crypto/internal/fips140/rsa/pkcs1v22.go index de7943773e6..94e7345996a 100644 --- a/src/crypto/internal/fips140/rsa/pkcs1v22.go +++ b/src/crypto/internal/fips140/rsa/pkcs1v22.go @@ -316,7 +316,7 @@ func VerifyPSS(pub *PublicKey, hash hash.Hash, digest []byte, sig []byte) error return verifyPSS(pub, hash, digest, sig, pssSaltLengthAutodetect) } -// VerifyPSS verifies sig with RSASSA-PSS and an expected salt length. +// VerifyPSSWithSaltLength verifies sig with RSASSA-PSS and an expected salt length. func VerifyPSSWithSaltLength(pub *PublicKey, hash hash.Hash, digest []byte, sig []byte, saltLength int) error { if saltLength < 0 { return errors.New("crypto/rsa: salt length cannot be negative") diff --git a/src/crypto/x509/oid.go b/src/crypto/x509/oid.go index b1464346b6b..c60daa7540c 100644 --- a/src/crypto/x509/oid.go +++ b/src/crypto/x509/oid.go @@ -286,7 +286,7 @@ func (oid OID) EqualASN1OID(other asn1.ObjectIdentifier) bool { return i == len(other) } -// Strings returns the string representation of the Object Identifier. +// String returns the string representation of the Object Identifier. func (oid OID) String() string { var b strings.Builder b.Grow(32) diff --git a/src/debug/dwarf/entry.go b/src/debug/dwarf/entry.go index 87414794833..30fad93e793 100644 --- a/src/debug/dwarf/entry.go +++ b/src/debug/dwarf/entry.go @@ -229,7 +229,7 @@ func formToClass(form format, attr Attr, vers int, b *buf) Class { } } -// An entry is a sequence of attribute/value pairs. +// An Entry is a sequence of attribute/value pairs. type Entry struct { Offset Offset // offset of Entry in DWARF info Tag Tag // tag (kind of Entry) diff --git a/src/go/scanner/scanner.go b/src/go/scanner/scanner.go index 153252b5cc3..cdbeb6323c6 100644 --- a/src/go/scanner/scanner.go +++ b/src/go/scanner/scanner.go @@ -107,7 +107,7 @@ func (s *Scanner) peek() byte { return 0 } -// A mode value is a set of flags (or 0). +// A Mode value is a set of flags (or 0). // They control scanner behavior. type Mode uint diff --git a/src/go/types/object.go b/src/go/types/object.go index 1bba5d52a8b..27dcb71956d 100644 --- a/src/go/types/object.go +++ b/src/go/types/object.go @@ -331,7 +331,7 @@ func (obj *TypeName) IsAlias() bool { } } -// A Variable represents a declared variable (including function parameters and results, and struct fields). +// A Var represents a declared variable (including function parameters and results, and struct fields). type Var struct { object origin *Var // if non-nil, the Var from which this one was instantiated diff --git a/src/internal/coverage/cmerge/merge.go b/src/internal/coverage/cmerge/merge.go index 1339803d086..9fc548eced5 100644 --- a/src/internal/coverage/cmerge/merge.go +++ b/src/internal/coverage/cmerge/merge.go @@ -57,7 +57,7 @@ func (m *Merger) MergeCounters(dst, src []uint32) (error, bool) { return nil, ovf } -// Saturating add does a saturating addition of 'dst' and 'src', +// SaturatingAdd does a saturating addition of 'dst' and 'src', // returning added value or math.MaxUint32 if there is an overflow. // Overflows are recorded in case the client needs to track them. func (m *Merger) SaturatingAdd(dst, src uint32) uint32 { @@ -68,7 +68,7 @@ func (m *Merger) SaturatingAdd(dst, src uint32) uint32 { return result } -// Saturating add does a saturating addition of 'dst' and 'src', +// SaturatingAdd does a saturating addition of 'dst' and 'src', // returning added value or math.MaxUint32 plus an overflow flag. func SaturatingAdd(dst, src uint32) (uint32, bool) { d, s := uint64(dst), uint64(src) diff --git a/src/internal/goarch/goarch.go b/src/internal/goarch/goarch.go index 4da56dda9da..efcf298d3b7 100644 --- a/src/internal/goarch/goarch.go +++ b/src/internal/goarch/goarch.go @@ -34,7 +34,7 @@ const ( // It is also the size of the machine's native word size (that is, 4 on 32-bit systems, 8 on 64-bit). const PtrSize = 4 << (^uintptr(0) >> 63) -// PtrSize is bit width of a pointer. +// PtrBits is bit width of a pointer. const PtrBits = PtrSize * 8 // ArchFamily is the architecture family (AMD64, ARM, ...) diff --git a/src/internal/runtime/maps/table.go b/src/internal/runtime/maps/table.go index 73ea76766ba..d9bcf23dfa0 100644 --- a/src/internal/runtime/maps/table.go +++ b/src/internal/runtime/maps/table.go @@ -716,7 +716,7 @@ func (it *Iter) Key() unsafe.Pointer { return it.key } -// Key returns a pointer to the current element. nil indicates end of +// Elem returns a pointer to the current element. nil indicates end of // iteration. // // Must not be called prior to Next. diff --git a/src/internal/trace/event.go b/src/internal/trace/event.go index 321e4e21fb3..b78e5232946 100644 --- a/src/internal/trace/event.go +++ b/src/internal/trace/event.go @@ -197,7 +197,7 @@ type Range struct { Scope ResourceID } -// RangeAttributes provides attributes about a completed Range. +// RangeAttribute provides attributes about a completed Range. type RangeAttribute struct { // Name is the human-readable name for the range. Name string diff --git a/src/runtime/mspanset.go b/src/runtime/mspanset.go index 21b105194e4..f0fb0628620 100644 --- a/src/runtime/mspanset.go +++ b/src/runtime/mspanset.go @@ -407,7 +407,7 @@ func (p *atomicMSpanPointer) Load() *mspan { return (*mspan)(p.p.Load()) } -// Store stores an *mspan. +// StoreNoWB stores an *mspan. func (p *atomicMSpanPointer) StoreNoWB(s *mspan) { p.p.StoreNoWB(unsafe.Pointer(s)) } diff --git a/src/text/template/parse/parse.go b/src/text/template/parse/parse.go index 84d639d78d1..b74dfb7f4ea 100644 --- a/src/text/template/parse/parse.go +++ b/src/text/template/parse/parse.go @@ -35,7 +35,7 @@ type Tree struct { stackDepth int // depth of nested parenthesized expressions } -// A mode value is a set of flags (or 0). Modes control parser behavior. +// A Mode value is a set of flags (or 0). Modes control parser behavior. type Mode uint const (