Skip to content

Commit

Permalink
all: remove trailing blank doc comment lines
Browse files Browse the repository at this point in the history
A future change to gofmt will rewrite

	// Doc comment.
	//
	func f()

to

	// Doc comment.
	func f()

Apply that change preemptively to all doc comments.

For #51082.

Change-Id: I4023e16cfb0729b64a8590f071cd92f17343081d
Reviewed-on: https://go-review.googlesource.com/c/go/+/384259
Trust: Russ Cox <[email protected]>
Run-TryBot: Russ Cox <[email protected]>
Reviewed-by: Ian Lance Taylor <[email protected]>
TryBot-Result: Gopher Robot <[email protected]>
  • Loading branch information
rsc committed Apr 1, 2022
1 parent 89dff11 commit 690ac40
Show file tree
Hide file tree
Showing 150 changed files with 0 additions and 387 deletions.
1 change: 0 additions & 1 deletion src/archive/zip/reader_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -865,7 +865,6 @@ func returnRecursiveZip() (r io.ReaderAt, size int64) {
//
// It's here in hex for the same reason as rZipBytes above: to avoid
// problems with on-disk virus scanners or other zip processors.
//
func biggestZipBytes() []byte {
s := `
0000000 50 4b 03 04 14 00 08 00 08 00 00 00 00 00 00 00
Expand Down
1 change: 0 additions & 1 deletion src/bufio/scan.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ import (
// advanced arbitrarily far past the last token. Programs that need more
// control over error handling or large tokens, or must run sequential scans
// on a reader, should use bufio.Reader instead.
//
type Scanner struct {
r io.Reader // The reader provided by the client.
split SplitFunc // The function to split the tokens.
Expand Down
1 change: 0 additions & 1 deletion src/cmd/asm/internal/asm/parse.go
Original file line number Diff line number Diff line change
Expand Up @@ -855,7 +855,6 @@ func (p *Parser) setPseudoRegister(addr *obj.Addr, reg string, isStatic bool, pr
//
// Anything else beginning with "<" logs an error if issueError is
// true, otherwise returns (false, obj.ABI0).
//
func (p *Parser) symRefAttrs(name string, issueError bool) (bool, obj.ABI) {
abi := obj.ABI0
isStatic := false
Expand Down
1 change: 0 additions & 1 deletion src/cmd/cgo/gcc.go
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,6 @@ func (p *Package) addToFlag(flag string, args []string) {
// Would be parsed as:
//
// []string{"a", "b:c d", "ef", `g"`}
//
func splitQuoted(s string) (r []string, err error) {
var args []string
arg := make([]rune, len(s))
Expand Down
2 changes: 0 additions & 2 deletions src/cmd/compile/internal/importer/gcimporter.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ var pkgExts = [...]string{".a", ".o"}
// the build.Default build.Context). A relative srcDir is interpreted
// relative to the current working directory.
// If no file was found, an empty filename is returned.
//
func FindPkg(path, srcDir string) (filename, id string) {
if path == "" {
return
Expand Down Expand Up @@ -84,7 +83,6 @@ func FindPkg(path, srcDir string) (filename, id string) {
// Import imports a gc-generated package given its import path and srcDir, adds
// the corresponding package object to the packages map, and returns the object.
// The packages map must contain all packages already imported.
//
func Import(packages map[string]*types2.Package, path, srcDir string, lookup func(path string) (io.ReadCloser, error)) (pkg *types2.Package, err error) {
var rc io.ReadCloser
var id string
Expand Down
3 changes: 0 additions & 3 deletions src/cmd/compile/internal/ir/fmt.go
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,6 @@ func (o Op) GoString() string {
//
// %v Go syntax ("+", "<-", "print")
// %+v Debug syntax ("ADD", "RECV", "PRINT")
//
func (o Op) Format(s fmt.State, verb rune) {
switch verb {
default:
Expand All @@ -129,7 +128,6 @@ func (o Op) Format(s fmt.State, verb rune) {
// %v Go syntax
// %L Go syntax followed by " (type T)" if type is known.
// %+v Debug syntax, as in Dump.
//
func fmtNode(n Node, s fmt.State, verb rune) {
// %+v prints Dump.
// Otherwise we print Go syntax.
Expand Down Expand Up @@ -926,7 +924,6 @@ func ellipsisIf(b bool) string {
// %v Go syntax, semicolon-separated
// %.v Go syntax, comma-separated
// %+v Debug syntax, as in DumpList.
//
func (l Nodes) Format(s fmt.State, verb rune) {
if s.Flag('+') && verb == 'v' {
// %+v is DumpList output
Expand Down
1 change: 0 additions & 1 deletion src/cmd/compile/internal/ir/mini.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ import (
// The embedding struct should also fill in n.op in its constructor,
// for more useful panic messages when invalid methods are called,
// instead of implementing Op itself.
//
type miniNode struct {
pos src.XPos // uint32
op Op // uint8
Expand Down
1 change: 0 additions & 1 deletion src/cmd/compile/internal/reflectdata/reflect.go
Original file line number Diff line number Diff line change
Expand Up @@ -1500,7 +1500,6 @@ func (a typesByString) Swap(i, j int) { a[i], a[j] = a[j], a[i] }
// use bitmaps for objects up to 64 kB in size.
//
// Also known to reflect/type.go.
//
const maxPtrmaskBytes = 2048

// GCSym returns a data symbol containing GC information for type t, along
Expand Down
1 change: 0 additions & 1 deletion src/cmd/compile/internal/ssa/compile.go
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,6 @@ var GenssaDump map[string]bool = make(map[string]bool) // names of functions to
// GO_GCFLAGS=-d=ssa/generic_cse/time,ssa/generic_cse/stats,ssa/generic_cse/debug=3 ./make.bash
//
// BOOT_GO_GCFLAGS=-d='ssa/~^.*scc$/off' GO_GCFLAGS='-d=ssa/~^.*scc$/off' ./make.bash
//
func PhaseOption(phase, flag string, val int, valString string) string {
switch phase {
case "", "help":
Expand Down
1 change: 0 additions & 1 deletion src/cmd/compile/internal/ssa/debug.go
Original file line number Diff line number Diff line change
Expand Up @@ -428,7 +428,6 @@ func (sc *slotCanonicalizer) canonSlot(idx SlKeyIdx) LocalSlot {
// This function examines the live OpArg{Int,Float}Reg values and
// synthesizes new (dead) values for the non-live params or the
// non-live pieces of partially live params.
//
func PopulateABIInRegArgOps(f *Func) {
pri := f.ABISelf.ABIAnalyzeFuncType(f.Type.FuncType())

Expand Down
1 change: 0 additions & 1 deletion src/cmd/compile/internal/ssa/debug_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,6 @@ var optimizedLibs = (!strings.Contains(gogcflags, "-N") && !strings.Contains(gog
// go test debug_test.go -args -u
// (for Delve)
// go test debug_test.go -args -u -d
//
func TestNexting(t *testing.T) {
testenv.SkipFlaky(t, 37404)

Expand Down
1 change: 0 additions & 1 deletion src/cmd/compile/internal/ssa/poset.go
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,6 @@ type posetNode struct {
// I extra
// / \
// J K
//
type poset struct {
lastidx uint32 // last generated dense index
flags uint8 // internal flags
Expand Down
1 change: 0 additions & 1 deletion src/cmd/compile/internal/syntax/parser.go
Original file line number Diff line number Diff line change
Expand Up @@ -471,7 +471,6 @@ func isEmptyFuncDecl(dcl Decl) bool {
// elements are accepted. list returns the position of the closing token.
//
// list = [ f { sep f } [sep] ] close .
//
func (p *parser) list(context string, sep, close token, f func() bool) Pos {
if debug && (sep != _Comma && sep != _Semi || close != _Rparen && close != _Rbrace && close != _Rbrack) {
panic("invalid sep or close argument for list")
Expand Down
1 change: 0 additions & 1 deletion src/cmd/compile/internal/syntax/syntax.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,6 @@ type PragmaHandler func(pos Pos, blank bool, text string, current Pragma) Pragma
// error, and the returned syntax tree is nil.
//
// If pragh != nil, it is called with each pragma encountered.
//
func Parse(base *PosBase, src io.Reader, errh ErrorHandler, pragh PragmaHandler, mode Mode) (_ *File, first error) {
defer func() {
if p := recover(); p != nil {
Expand Down
1 change: 0 additions & 1 deletion src/cmd/compile/internal/test/zerorange_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,6 @@ func triggerZerorangeSmall(f, g, h uint64) (rv0 uint64) {
// depending on the size of the thing that needs to be zeroed out
// (I've verified at the time of the writing of this test that it
// exercises the various cases).
//
func TestZerorange45372(t *testing.T) {
if r := triggerZerorangeLarge(101, 303, 505); r != 1010 {
t.Errorf("large: wanted %d got %d", 1010, r)
Expand Down
2 changes: 0 additions & 2 deletions src/cmd/compile/internal/types/fmt.go
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,6 @@ const (
// %v Go syntax: Name for symbols in the local package, PkgName.Name for imported symbols.
// %+v Debug syntax: always include PkgName. prefix even for local names.
// %S Short syntax: Name only, no matter what.
//
func (s *Sym) Format(f fmt.State, verb rune) {
mode := fmtGo
switch verb {
Expand Down Expand Up @@ -241,7 +240,6 @@ var fmtBufferPool = sync.Pool{
// %L Go syntax for underlying type if t is named
// %S short Go syntax: drop leading "func" in function type
// %-S special case for method receiver symbol
//
func (t *Type) Format(s fmt.State, verb rune) {
mode := fmtGo
switch verb {
Expand Down
2 changes: 0 additions & 2 deletions src/cmd/compile/internal/types2/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,6 @@ type Info struct {

// TypeOf returns the type of expression e, or nil if not found.
// Precondition: the Types, Uses and Defs maps are populated.
//
func (info *Info) TypeOf(e syntax.Expr) Type {
if t, ok := info.Types[e]; ok {
return t.Type
Expand All @@ -305,7 +304,6 @@ func (info *Info) TypeOf(e syntax.Expr) Type {
// it defines, not the type (*TypeName) it uses.
//
// Precondition: the Uses and Defs maps are populated.
//
func (info *Info) ObjectOf(id *syntax.Name) Object {
if obj := info.Defs[id]; obj != nil {
return obj
Expand Down
1 change: 0 additions & 1 deletion src/cmd/compile/internal/types2/builtins.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ import (
// reports whether the call is valid, with *x holding the result;
// but x.expr is not set. If the call is invalid, the result is
// false, and *x is undefined.
//
func (check *Checker) builtin(x *operand, call *syntax.CallExpr, id builtinId) (_ bool) {
// append is the only built-in that permits the use of ... for the last argument
bin := predeclaredFuncs[id]
Expand Down
5 changes: 0 additions & 5 deletions src/cmd/compile/internal/types2/expr.go
Original file line number Diff line number Diff line change
Expand Up @@ -1211,7 +1211,6 @@ const (
// If hint != nil, it is the type of a composite literal element.
// If allowGeneric is set, the operand type may be an uninstantiated
// parameterized type or function value.
//
func (check *Checker) rawExpr(x *operand, e syntax.Expr, hint Type, allowGeneric bool) exprKind {
if check.conf.Trace {
check.trace(e.Pos(), "-- expr %s", e)
Expand Down Expand Up @@ -1259,7 +1258,6 @@ func (check *Checker) nonGeneric(x *operand) {

// exprInternal contains the core of type checking of expressions.
// Must only be called by rawExpr.
//
func (check *Checker) exprInternal(x *operand, e syntax.Expr, hint Type) exprKind {
// make sure x has a valid state in case of bailout
// (was issue 5770)
Expand Down Expand Up @@ -1764,7 +1762,6 @@ func (check *Checker) typeAssertion(e syntax.Expr, x *operand, T Type, typeSwitc
// expr typechecks expression e and initializes x with the expression value.
// The result must be a single value.
// If an error occurred, x.mode is set to invalid.
//
func (check *Checker) expr(x *operand, e syntax.Expr) {
check.rawExpr(x, e, nil, false)
check.exclude(x, 1<<novalue|1<<builtin|1<<typexpr)
Expand All @@ -1780,7 +1777,6 @@ func (check *Checker) multiExpr(x *operand, e syntax.Expr) {
// exprWithHint typechecks expression e and initializes x with the expression value;
// hint is the type of a composite literal element.
// If an error occurred, x.mode is set to invalid.
//
func (check *Checker) exprWithHint(x *operand, e syntax.Expr, hint Type) {
assert(hint != nil)
check.rawExpr(x, e, hint, false)
Expand All @@ -1792,7 +1788,6 @@ func (check *Checker) exprWithHint(x *operand, e syntax.Expr, hint Type) {
// If allowGeneric is set, the operand type may be an uninstantiated parameterized type or function
// value.
// If an error occurred, x.mode is set to invalid.
//
func (check *Checker) exprOrType(x *operand, e syntax.Expr, allowGeneric bool) {
check.rawExpr(x, e, nil, allowGeneric)
check.exclude(x, 1<<novalue)
Expand Down
2 changes: 0 additions & 2 deletions src/cmd/compile/internal/types2/lookup.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ import (
// - If indirect is set, a method with a pointer receiver type was found
// but there was no pointer on the path from the actual receiver type to
// the method's formal receiver base type, nor was the receiver addressable.
//
func LookupFieldOrMethod(T Type, addressable bool, pkg *Package, name string) (obj Object, index []int, indirect bool) {
if T == nil {
panic("LookupFieldOrMethod on nil type")
Expand Down Expand Up @@ -281,7 +280,6 @@ func lookupType(m map[Type]int, typ Type) (int, bool) {
// is not set), MissingMethod only checks that methods of T which are also
// present in V have matching types (e.g., for a type assertion x.(T) where
// x is of interface type V).
//
func MissingMethod(V Type, T *Interface, static bool) (method *Func, wrongType bool) {
m, alt := (*Checker)(nil).missingMethod(V, T, static)
// Only report a wrong type if the alternative method has the same name as m.
Expand Down
1 change: 0 additions & 1 deletion src/cmd/compile/internal/types2/object.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ import (
// An Object describes a named language entity such as a package,
// constant, type, variable, function (incl. methods), or label.
// All objects implement the Object interface.
//
type Object interface {
Parent() *Scope // scope in which this object is declared; nil for methods and struct fields
Pos() syntax.Pos // position of object identifier in declaration
Expand Down
3 changes: 0 additions & 3 deletions src/cmd/compile/internal/types2/operand.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@ var operandModeString = [...]string{
// the operand, the operand's type, a value for constants, and an id
// for built-in functions.
// The zero value of operand is a ready to use invalid operand.
//
type operand struct {
mode operandMode
expr syntax.Expr
Expand All @@ -63,7 +62,6 @@ type operand struct {

// Pos returns the position of the expression corresponding to x.
// If x is invalid the position is nopos.
//
func (x *operand) Pos() syntax.Pos {
// x.expr may not be set if x is invalid
if x.expr == nil {
Expand Down Expand Up @@ -108,7 +106,6 @@ func (x *operand) Pos() syntax.Pos {
//
// cgofunc <expr> (<untyped kind> <mode> )
// cgofunc <expr> ( <mode> of type <typ>)
//
func operandString(x *operand, qf Qualifier) string {
// special-case nil
if x.mode == nilvalue {
Expand Down
2 changes: 0 additions & 2 deletions src/cmd/compile/internal/types2/selection.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ const (
// p.x FieldVal T x int {0} true
// p.m MethodVal *T m func() {1, 0} true
// T.m MethodExpr T m func(T) {1, 0} false
//
type Selection struct {
kind SelectionKind
recv Type // type of x
Expand Down Expand Up @@ -115,7 +114,6 @@ func (s *Selection) String() string { return SelectionString(s, nil) }
// "field (T) f int"
// "method (T) f(X) Y"
// "method expr (T) f(X) Y"
//
func SelectionString(s *Selection, qf Qualifier) string {
var k string
switch s.kind {
Expand Down
1 change: 0 additions & 1 deletion src/cmd/compile/internal/types2/sizes.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ type Sizes interface {
// types are naturally aligned with a maximum alignment MaxAlign.
//
// *StdSizes implements Sizes.
//
type StdSizes struct {
WordSize int64 // word size in bytes - must be >= 4 (32bits)
MaxAlign int64 // maximum alignment in bytes - must be >= 1
Expand Down
1 change: 0 additions & 1 deletion src/cmd/compile/internal/types2/typestring.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ import (
//
// Using a nil Qualifier is equivalent to using (*Package).Path: the
// object is qualified by the import path, e.g., "encoding/json.Marshal".
//
type Qualifier func(*Package) string

// RelativeTo returns a Qualifier that fully qualifies members of
Expand Down
1 change: 0 additions & 1 deletion src/cmd/compile/internal/types2/typeterm.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ package types2
// 𝓤: &term{} == 𝓤 // set of all types (𝓤niverse)
// T: &term{false, T} == {T} // set of type T
// ~t: &term{true, t} == {t' | under(t') == t} // set of types with underlying type t
//
type term struct {
tilde bool // valid if typ != nil
typ Type
Expand Down
3 changes: 0 additions & 3 deletions src/cmd/compile/internal/types2/typexpr.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ import (
// If an error occurred, x.mode is set to invalid.
// For the meaning of def, see Checker.definedType, below.
// If wantType is set, the identifier e is expected to denote a type.
//
func (check *Checker) ident(x *operand, e *syntax.Name, def *Named, wantType bool) {
x.mode = invalid
x.expr = e
Expand Down Expand Up @@ -181,7 +180,6 @@ func (check *Checker) validVarType(e syntax.Expr, typ Type) {
// If def != nil, e is the type specification for the defined type def, declared
// in a type declaration, and def.underlying will be set to the type of e before
// any components of e are type-checked.
//
func (check *Checker) definedType(e syntax.Expr, def *Named) Type {
typ := check.typInternal(e, def)
assert(isTyped(typ))
Expand Down Expand Up @@ -216,7 +214,6 @@ func goTypeName(typ Type) string {

// typInternal drives type checking of types.
// Must only be called by definedType or genericType.
//
func (check *Checker) typInternal(e0 syntax.Expr, def *Named) (T Type) {
if check.conf.Trace {
check.trace(e0.Pos(), "-- type %s", e0)
Expand Down
1 change: 0 additions & 1 deletion src/cmd/compile/internal/types2/universe.go
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,6 @@ func init() {
// Objects with names containing blanks are internal and not entered into
// a scope. Objects with exported names are inserted in the unsafe package
// scope; other objects are inserted in the universe scope.
//
func def(obj Object) {
assert(obj.color() == black)
name := obj.Name()
Expand Down
1 change: 0 additions & 1 deletion src/cmd/compile/internal/walk/builtin.go
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,6 @@ func walkClose(n *ir.UnaryExpr, init *ir.Nodes) ir.Node {
// n;
//
// Also works if b is a string.
//
func walkCopy(n *ir.BinaryExpr, init *ir.Nodes, runtimecall bool) ir.Node {
if n.X.Type().Elem().HasPointers() {
ir.CurFunc.SetWBPos(n.Pos())
Expand Down
1 change: 0 additions & 1 deletion src/cmd/cover/cover_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,6 @@ func buildCover(t *testing.T) {
// go build -o testcover
// testcover -mode=count -var=CoverTest -o ./testdata/test_cover.go testdata/test_line.go
// go run ./testdata/main.go ./testdata/test.go
//
func TestCover(t *testing.T) {
t.Parallel()
testenv.MustHaveGoRun(t)
Expand Down
2 changes: 0 additions & 2 deletions src/cmd/dist/buildruntime.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ import (
// package sys
//
// const StackGuardMultiplier = <multiplier value>
//
func mkzversion(dir, file string) {
var buf bytes.Buffer
fmt.Fprintf(&buf, "// Code generated by go tool dist; DO NOT EDIT.\n")
Expand Down Expand Up @@ -80,7 +79,6 @@ func mkbuildcfg(file string) {
// package objabi
//
// const stackGuardMultiplierDefault = <multiplier value>
//
func mkobjabi(file string) {
var buf bytes.Buffer
fmt.Fprintf(&buf, "// Code generated by go tool dist; DO NOT EDIT.\n")
Expand Down
1 change: 0 additions & 1 deletion src/cmd/go/internal/cache/cache.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ type Cache struct {
// to share a cache directory (for example, if the directory were stored
// in a network file system). File locking is notoriously unreliable in
// network file systems and may not suffice to protect the cache.
//
func Open(dir string) (*Cache, error) {
info, err := os.Stat(dir)
if err != nil {
Expand Down
1 change: 0 additions & 1 deletion src/cmd/go/internal/imports/build.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,6 @@ func isGoBuildComment(line []byte) bool {
// the purpose of satisfying build tags, in order to estimate
// (conservatively) whether a file could ever possibly be used
// in any build.
//
func ShouldBuild(content []byte, tags map[string]bool) bool {
// Identify leading run of // comments and blank lines,
// which must be followed by a blank line.
Expand Down
1 change: 0 additions & 1 deletion src/cmd/go/internal/modload/load.go
Original file line number Diff line number Diff line change
Expand Up @@ -2151,7 +2151,6 @@ func (ld *loader) buildStacks() {
// other2 tested by
// other2.test imports
// pkg
//
func (pkg *loadPkg) stackText() string {
var stack []*loadPkg
for p := pkg; p != nil; p = p.stack {
Expand Down
Loading

0 comments on commit 690ac40

Please sign in to comment.