]> Cypherpunks.ru repositories - gostls13.git/commitdiff
all: remove trailing blank doc comment lines
authorRuss Cox <rsc@golang.org>
Mon, 31 Jan 2022 01:11:47 +0000 (20:11 -0500)
committerRuss Cox <rsc@golang.org>
Fri, 1 Apr 2022 18:18:07 +0000 (18:18 +0000)
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 <rsc@golang.org>
Run-TryBot: Russ Cox <rsc@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>

150 files changed:
src/archive/zip/reader_test.go
src/bufio/scan.go
src/cmd/asm/internal/asm/parse.go
src/cmd/cgo/gcc.go
src/cmd/compile/internal/importer/gcimporter.go
src/cmd/compile/internal/ir/fmt.go
src/cmd/compile/internal/ir/mini.go
src/cmd/compile/internal/reflectdata/reflect.go
src/cmd/compile/internal/ssa/compile.go
src/cmd/compile/internal/ssa/debug.go
src/cmd/compile/internal/ssa/debug_test.go
src/cmd/compile/internal/ssa/poset.go
src/cmd/compile/internal/syntax/parser.go
src/cmd/compile/internal/syntax/syntax.go
src/cmd/compile/internal/test/zerorange_test.go
src/cmd/compile/internal/types/fmt.go
src/cmd/compile/internal/types2/api.go
src/cmd/compile/internal/types2/builtins.go
src/cmd/compile/internal/types2/expr.go
src/cmd/compile/internal/types2/lookup.go
src/cmd/compile/internal/types2/object.go
src/cmd/compile/internal/types2/operand.go
src/cmd/compile/internal/types2/selection.go
src/cmd/compile/internal/types2/sizes.go
src/cmd/compile/internal/types2/typestring.go
src/cmd/compile/internal/types2/typeterm.go
src/cmd/compile/internal/types2/typexpr.go
src/cmd/compile/internal/types2/universe.go
src/cmd/compile/internal/walk/builtin.go
src/cmd/cover/cover_test.go
src/cmd/dist/buildruntime.go
src/cmd/go/internal/cache/cache.go
src/cmd/go/internal/imports/build.go
src/cmd/go/internal/modload/load.go
src/cmd/go/internal/vet/vetflag.go
src/cmd/go/internal/work/exec.go
src/cmd/go/script_test.go
src/cmd/internal/obj/riscv/obj.go
src/cmd/internal/obj/x86/asm6.go
src/cmd/link/internal/ld/dwarf_test.go
src/cmd/link/internal/loader/loader.go
src/container/ring/ring.go
src/crypto/elliptic/internal/fiat/p224_fiat64.go
src/crypto/elliptic/internal/fiat/p384_fiat64.go
src/crypto/elliptic/internal/fiat/p521_fiat64.go
src/crypto/elliptic/p256_ppc64le.go
src/crypto/tls/cipher_suites.go
src/database/sql/fakedb_test.go
src/database/sql/sql.go
src/debug/dwarf/entry.go
src/encoding/ascii85/ascii85.go
src/encoding/binary/varint.go
src/encoding/json/decode.go
src/encoding/json/encode.go
src/encoding/json/stream.go
src/go/ast/ast.go
src/go/ast/commentmap.go
src/go/ast/commentmap_test.go
src/go/ast/filter.go
src/go/ast/filter_test.go
src/go/ast/resolve.go
src/go/ast/scope.go
src/go/ast/walk.go
src/go/build/build.go
src/go/build/deps_test.go
src/go/constant/value.go
src/go/doc/doc.go
src/go/doc/example.go
src/go/doc/exports.go
src/go/doc/filter.go
src/go/doc/reader.go
src/go/doc/synopsis.go
src/go/format/benchmark_test.go
src/go/format/format.go
src/go/internal/gccgoimporter/parser.go
src/go/internal/gcimporter/exportdata.go
src/go/internal/gcimporter/gcimporter.go
src/go/parser/error_test.go
src/go/parser/interface.go
src/go/parser/parser.go
src/go/parser/resolver.go
src/go/printer/nodes.go
src/go/printer/printer.go
src/go/printer/printer_test.go
src/go/printer/testdata/parser.go
src/go/scanner/errors.go
src/go/scanner/scanner.go
src/go/token/position.go
src/go/token/token.go
src/go/types/api.go
src/go/types/builtins.go
src/go/types/check_test.go
src/go/types/eval.go
src/go/types/expr.go
src/go/types/index.go
src/go/types/lookup.go
src/go/types/object.go
src/go/types/operand.go
src/go/types/selection.go
src/go/types/sizes.go
src/go/types/typestring.go
src/go/types/typeterm.go
src/go/types/typexpr.go
src/go/types/universe.go
src/html/template/template.go
src/index/suffixarray/suffixarray.go
src/internal/fmtsort/sort.go
src/io/fs/walk.go
src/math/big/float.go
src/math/big/floatconv.go
src/math/big/int.go
src/math/big/intconv.go
src/math/big/nat.go
src/math/big/natconv.go
src/math/big/rat.go
src/math/rand/exp.go
src/math/rand/normal.go
src/math/rand/rand.go
src/net/http/client.go
src/net/http/fs.go
src/net/http/transport.go
src/net/textproto/reader.go
src/net/textproto/textproto.go
src/path/filepath/match.go
src/path/match.go
src/reflect/all_test.go
src/reflect/makefunc.go
src/reflect/value.go
src/regexp/exec_test.go
src/regexp/syntax/parse.go
src/runtime/chan.go
src/runtime/compiler.go
src/runtime/lock_sema.go
src/runtime/pprof/pprof.go
src/runtime/profbuf.go
src/runtime/trace/annotation.go
src/sort/search.go
src/sort/search_test.go
src/sort/sort.go
src/strconv/itoa.go
src/sync/cond.go
src/sync/once.go
src/testing/fstest/testfs.go
src/text/scanner/scanner.go
src/text/tabwriter/tabwriter.go
src/text/template/option.go
src/time/format.go
src/time/time.go
src/unicode/letter.go
src/unsafe/unsafe.go

index d1a9bdd3346e519cb8afc75fc13475094e7249ad..9bc23642c0e66f7e05eeb2565f0215654106b8fc 100644 (file)
@@ -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
index 4846d4f733677777a50e24d971cdf643954d4f23..e247cbcf32f55c631be2f6a634e7c3acfc0cc418 100644 (file)
@@ -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.
index 0bdf868f4857422c3b38f35f8b57cd2f4026c7c8..59aedbf0cc59fac46762de66b861e33948341fd8 100644 (file)
@@ -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
index 997a830994f09bdd6118299e31e20125cadff3ff..9877182fc4b82e3e3c459207fa091abf4e8e4fb2 100644 (file)
@@ -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))
index 6c27f8b332fc7e1112566f2c08660ed5819ed991..bcf0480cfc87adb7a2a9e1eeca43ef9d1366f868 100644 (file)
@@ -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
@@ -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
index 12a463c8a40e0a6a429d660f015013b2a92758b0..a00667b309c18d4bc912641be15779e9c5733475 100644 (file)
@@ -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:
@@ -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.
@@ -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
index 801a48a78e4509716692d248f59c5d6640855708..98c0ffa5b069912d75f22eca964039d6f84244f3 100644 (file)
@@ -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
index 908f81865e0ceea2dfd7da7fe91d61acdf299105..9961c8f65a46620b4ff3b9af503917b9c8cd7aaa 100644 (file)
@@ -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
index d006bf9a3b89fd65eb12e20f36bf2a60eef58bfe..f95140eaf9ef10ee285a95f909df0503c884694d 100644 (file)
@@ -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":
index aad59fa24ec9c46e60b49315bc4a2aeacfe77ec7..08dc5c468ecd33740ed46d69ec00a54691035250 100644 (file)
@@ -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())
 
index b20041c1b575a02926aefcf591c5993fe16c349a..2fc12557c055de1725c6f02e1608194524d55e45 100644 (file)
@@ -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)
 
index ee884ca7610f21846fd252aee6c0a8977450cd9b..200106e66db42c33c053b97a585ada33aaf39d1d 100644 (file)
@@ -145,7 +145,6 @@ type posetNode struct {
 //       I  extra
 //           /  \
 //          J    K
-//
 type poset struct {
        lastidx   uint32            // last generated dense index
        flags     uint8             // internal flags
index 6574b01371bbc1013c4d836796e58025b184f331..f18d5268772f1771797616ee0b60bd84c97e0d4f 100644 (file)
@@ -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")
index e51b5538b3b18221a111830519f12358528f6d7b..83b102da9f564e72fe41dc8da27146aabd63699e 100644 (file)
@@ -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 {
index ec87136157209c377e556e23e20fbbf66a4cf9f5..e92b5d342fe136348e2c82d9c33eeb27702c3869 100644 (file)
@@ -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)
index a42d97cd31c71a1ef46e9839010da476ceeeba9c..bdd3ca1d2874f48b3f365054dfdf6e3827e2f6b0 100644 (file)
@@ -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 {
@@ -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 {
index d864c96fb612ace875b9d4291fd4e5cadcb7a3f2..34bb29cadcce4061cd243095cf26209244e7b520 100644 (file)
@@ -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
@@ -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
index 428897c62828482f6c05442950351f72c4efde5f..1bd2fdce069334bfdb796313034c4aa802a1ef56 100644 (file)
@@ -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]
index 23225c8d0d66fbee0fceec55c21c61f124134005..1ecb4ff54bd77b058e1a9cfd4be82553df9c6d87 100644 (file)
@@ -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)
@@ -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)
@@ -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)
@@ -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)
@@ -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)
index 335e4d0c2326a20bcce03341a7906fafef9e9310..93defd661852deab3ad4bc2260dffb50a17a225d 100644 (file)
@@ -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")
@@ -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.
index ee7c8a848808ef9fb5411ca0aa5a399356bb4b48..9043b372ea08137c6b7e73affddf841ff47c0471 100644 (file)
@@ -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
index fce9a11ffa2f5a85474b737d5835db92ebb64087..548244e64dc195b5efe300b1f929c6d68e6ac45c 100644 (file)
@@ -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
@@ -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 {
@@ -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 {
index 8128aeee2e5113b6979990cfba4e94e373b206a9..ee632144071398fadd94e8f1a227bfb683c89b04 100644 (file)
@@ -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
@@ -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 {
index 6f981964be1afdfdaf9ac2d64918cbdbb4a73bb7..7a34b6474cd44fb47f4cef45199149daeef70248 100644 (file)
@@ -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
index ada0529929972467bf7c312d21100cda99001e39..e0f36fcec47cfdfd1c007ecafc835417bf06cc2a 100644 (file)
@@ -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
index 1d7223f13c42c013e06c8d8f1fb9cf4b423a7fb2..3d82a37ab8347452b993f0eb7006c1eacdf9839f 100644 (file)
@@ -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
index afbea060329d839956b78762c63fcb2b106f6301..8b9976da7988af917390028a55beeaf0d7d5c355 100644 (file)
@@ -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
@@ -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))
@@ -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)
index 1deff3961f501a7d8064d76db3e3cd878a0ee282..9292924f234b8d2b150a5155a0e5a6f697d21842 100644 (file)
@@ -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()
index 8fe231161a44a733d60194022ae5f1d8f7267334..7ec5494d996863b97c994d853a00557e53249501 100644 (file)
@@ -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())
index 86c95d15c5d28f808eda67ea84ca121c946a9577..8bd31514a0499bd762b1b14f35c01f65ec271644 100644 (file)
@@ -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)
index fdc1d257744fcdba092d5db466acdcf4e321ac13..e66a9f009f8604627279df3dde86c7051d990bbc 100644 (file)
@@ -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")
@@ -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")
index 93d7c25658fa07eef33d282ff3e61e90cf63d616..4ac2b818ff83e875a47b6beb93fc1d98aa148479 100644 (file)
@@ -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 {
index ff6bea6777dce89c81385f1e38182e43de12f821..10e90fc216a72d1c68b4005dbf2c601c995b6a40 100644 (file)
@@ -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.
index d4847efb9880b0365af3e5374692333d5b105043..c17069953547c98673d8a75b26dc43474b47b40c 100644 (file)
@@ -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 {
index 3551a5997c5f887d5c3f9f8dd00ac462a902f46b..8a55e9cca0c2dcc1ef762e8e66e0d3a13f42d8cd 100644 (file)
@@ -35,7 +35,6 @@ import (
 // implementation. It is also used by tests.
 //
 // The default behavior (vetTool=="") runs 'go tool vet'.
-//
 var vetTool string // -vettool
 
 func init() {
index 6d6837aa8a2b7da2d33066ed1b49c6d33fd051af..4252209f1002fd4a4a8e062c32f44c2342802a5f 100644 (file)
@@ -1948,7 +1948,6 @@ func mayberemovefile(s string) {
 //
 //     fmtcmd replaces the name of the current directory with dot (.)
 //     but only when it is at the beginning of a space-separated token.
-//
 func (b *Builder) fmtcmd(dir string, format string, args ...any) string {
        cmd := fmt.Sprintf(format, args...)
        if dir != "" && dir != "/" {
@@ -2005,7 +2004,6 @@ func (b *Builder) Showcmd(dir string, format string, args ...any) {
 //
 // If a is not nil and a.output is not nil, showOutput appends to that slice instead of
 // printing to b.Print.
-//
 func (b *Builder) showOutput(a *Action, dir, desc, out string) {
        prefix := "# " + desc
        suffix := "\n" + out
index 76a2b85f96df5cfe15f7c18a97281b7dc9c012fa..76c542f32a21c03212d69d938606623a83f36724 100644 (file)
@@ -490,7 +490,6 @@ func isCaseSensitive(t *testing.T) bool {
 // Keep list and the implementations below sorted by name.
 //
 // NOTE: If you make changes here, update testdata/script/README too!
-//
 var scriptCmds = map[string]func(*testScript, simpleStatus, []string){
        "addcrlf": (*testScript).cmdAddcrlf,
        "cc":      (*testScript).cmdCc,
index 2c00c87aa2882d71401bffab5decbf1b229fbb2f..956d69ee2e7658935c34bab18f313852247ccc5d 100644 (file)
@@ -324,7 +324,6 @@ func setPCs(p *obj.Prog, pc int64) int64 {
 //
 // A nicer version of this diagram can be found on slide 21 of the presentation
 // attached to https://golang.org/issue/16922#issuecomment-243748180.
-//
 func stackOffset(a *obj.Addr, stacksize int64) {
        switch a.Name {
        case obj.NAME_AUTO:
index a508e484e4741c6ee0f6d4a449ea3d6d0e9748bc..64a0bc96b7ac7f99bb39e82945bc708a58045a38 100644 (file)
@@ -59,7 +59,6 @@ var (
 // is very slight but negative, so the alignment is disabled by
 // setting MaxLoopPad = 0. The code is here for reference and
 // for future experiments.
-//
 const (
        loopAlign  = 16
        maxLoopPad = 0
@@ -4167,7 +4166,6 @@ func (ab *AsmBuf) asmvex(ctxt *obj.Link, rm, v, r *obj.Addr, vex, opcode uint8)
 //     REG_X15 => 15
 //     REG_R9  => 9
 //     REG_AX  => 0
-//
 func regIndex(r int16) int {
        lower3bits := reg[r]
        high4bit := regrex[r] & Rxr << 1
index 2f9bf25d101c1fcb1f0f4d63bb885745e4f6b441..1f7b37f892ea1a062bafe45dad4323d61180f8e3 100644 (file)
@@ -1469,7 +1469,6 @@ func TestIssue42484(t *testing.T) {
 //     i1:0:1 f1:1:1 ~r0:2:2 ~r1:3:2
 //
 // where each chunk above is of the form NAME:ORDER:INOUTCLASSIFICATION
-//
 func processParams(die *dwarf.Entry, ex *dwtest.Examiner) string {
        // Values in the returned map are of the form <order>:<varparam>
        // where order is the order within the child DIE list of the
index d102bb35ced68c87e841ac1b9ef3bb048f419e40..2cbec5d06f310abd80b2ab4782a2c030b65efb02 100644 (file)
@@ -2579,7 +2579,6 @@ type ErrorReporter struct {
 //
 // Logging an error means that on exit cmd/link will delete any
 // output file and return a non-zero error code.
-//
 func (reporter *ErrorReporter) Errorf(s Sym, format string, args ...interface{}) {
        if s != 0 && reporter.ldr.SymName(s) != "" {
                // Note: Replace is needed here because symbol names might have % in them,
index ce15032543be9202953c66882ca06b06dbf34a94..268670bc8524aa20d23817d1f5efded5f4eb64b9 100644 (file)
@@ -10,7 +10,6 @@ package ring
 // serves as reference to the entire ring. Empty rings are represented
 // as nil Ring pointers. The zero value for a Ring is a one-element
 // ring with a nil Value.
-//
 type Ring struct {
        next, prev *Ring
        Value      any // for use by client; untouched by this library
@@ -40,7 +39,6 @@ func (r *Ring) Prev() *Ring {
 
 // Move moves n % r.Len() elements backward (n < 0) or forward (n >= 0)
 // in the ring and returns that ring element. r must not be empty.
-//
 func (r *Ring) Move(n int) *Ring {
        if r.next == nil {
                return r.init()
@@ -89,7 +87,6 @@ func New(n int) *Ring {
 // them creates a single ring with the elements of s inserted
 // after r. The result points to the element following the
 // last element of s after insertion.
-//
 func (r *Ring) Link(s *Ring) *Ring {
        n := r.Next()
        if s != nil {
@@ -107,7 +104,6 @@ func (r *Ring) Link(s *Ring) *Ring {
 // Unlink removes n % r.Len() elements from the ring r, starting
 // at r.Next(). If n % r.Len() == 0, r remains unchanged.
 // The result is the removed subring. r must not be empty.
-//
 func (r *Ring) Unlink(n int) *Ring {
        if n <= 0 {
                return nil
@@ -117,7 +113,6 @@ func (r *Ring) Unlink(n int) *Ring {
 
 // Len computes the number of elements in ring r.
 // It executes in time proportional to the number of elements.
-//
 func (r *Ring) Len() int {
        n := 0
        if r != nil {
index 4ece3e9220837eff7a51e78deb12e40dbe4c3ae9..588e9ea62049c9a612f977e1220f04ef969a7969 100644 (file)
@@ -78,7 +78,6 @@ func p224CmovznzU64(out1 *uint64, arg1 p224Uint1, arg2 uint64, arg3 uint64) {
 // Postconditions:
 //   eval (from_montgomery out1) mod m = (eval (from_montgomery arg1) * eval (from_montgomery arg2)) mod m
 //   0 ≤ eval out1 < m
-//
 func p224Mul(out1 *p224MontgomeryDomainFieldElement, arg1 *p224MontgomeryDomainFieldElement, arg2 *p224MontgomeryDomainFieldElement) {
        x1 := arg1[1]
        x2 := arg1[2]
@@ -383,7 +382,6 @@ func p224Mul(out1 *p224MontgomeryDomainFieldElement, arg1 *p224MontgomeryDomainF
 // Postconditions:
 //   eval (from_montgomery out1) mod m = (eval (from_montgomery arg1) * eval (from_montgomery arg1)) mod m
 //   0 ≤ eval out1 < m
-//
 func p224Square(out1 *p224MontgomeryDomainFieldElement, arg1 *p224MontgomeryDomainFieldElement) {
        x1 := arg1[1]
        x2 := arg1[2]
@@ -689,7 +687,6 @@ func p224Square(out1 *p224MontgomeryDomainFieldElement, arg1 *p224MontgomeryDoma
 // Postconditions:
 //   eval (from_montgomery out1) mod m = (eval (from_montgomery arg1) + eval (from_montgomery arg2)) mod m
 //   0 ≤ eval out1 < m
-//
 func p224Add(out1 *p224MontgomeryDomainFieldElement, arg1 *p224MontgomeryDomainFieldElement, arg2 *p224MontgomeryDomainFieldElement) {
        var x1 uint64
        var x2 uint64
@@ -739,7 +736,6 @@ func p224Add(out1 *p224MontgomeryDomainFieldElement, arg1 *p224MontgomeryDomainF
 // Postconditions:
 //   eval (from_montgomery out1) mod m = (eval (from_montgomery arg1) - eval (from_montgomery arg2)) mod m
 //   0 ≤ eval out1 < m
-//
 func p224Sub(out1 *p224MontgomeryDomainFieldElement, arg1 *p224MontgomeryDomainFieldElement, arg2 *p224MontgomeryDomainFieldElement) {
        var x1 uint64
        var x2 uint64
@@ -777,7 +773,6 @@ func p224Sub(out1 *p224MontgomeryDomainFieldElement, arg1 *p224MontgomeryDomainF
 // Postconditions:
 //   eval (from_montgomery out1) mod m = 1 mod m
 //   0 ≤ eval out1 < m
-//
 func p224SetOne(out1 *p224MontgomeryDomainFieldElement) {
        out1[0] = 0xffffffff00000000
        out1[1] = 0xffffffffffffffff
@@ -792,7 +787,6 @@ func p224SetOne(out1 *p224MontgomeryDomainFieldElement) {
 // Postconditions:
 //   eval out1 mod m = (eval arg1 * ((2^64)⁻¹ mod m)^4) mod m
 //   0 ≤ eval out1 < m
-//
 func p224FromMontgomery(out1 *p224NonMontgomeryDomainFieldElement, arg1 *p224MontgomeryDomainFieldElement) {
        x1 := arg1[0]
        var x2 uint64
@@ -970,7 +964,6 @@ func p224FromMontgomery(out1 *p224NonMontgomeryDomainFieldElement, arg1 *p224Mon
 // Postconditions:
 //   eval (from_montgomery out1) mod m = eval arg1 mod m
 //   0 ≤ eval out1 < m
-//
 func p224ToMontgomery(out1 *p224MontgomeryDomainFieldElement, arg1 *p224NonMontgomeryDomainFieldElement) {
        x1 := arg1[1]
        x2 := arg1[2]
index 493bed47e1c2bf12702d4d8c8e4aa5f1eea45224..dc48cd38fb47af3d4b6b8390e75e88bac0a779d3 100644 (file)
@@ -78,7 +78,6 @@ func p384CmovznzU64(out1 *uint64, arg1 p384Uint1, arg2 uint64, arg3 uint64) {
 // Postconditions:
 //   eval (from_montgomery out1) mod m = (eval (from_montgomery arg1) * eval (from_montgomery arg2)) mod m
 //   0 ≤ eval out1 < m
-//
 func p384Mul(out1 *p384MontgomeryDomainFieldElement, arg1 *p384MontgomeryDomainFieldElement, arg2 *p384MontgomeryDomainFieldElement) {
        x1 := arg1[1]
        x2 := arg1[2]
@@ -783,7 +782,6 @@ func p384Mul(out1 *p384MontgomeryDomainFieldElement, arg1 *p384MontgomeryDomainF
 // Postconditions:
 //   eval (from_montgomery out1) mod m = (eval (from_montgomery arg1) * eval (from_montgomery arg1)) mod m
 //   0 ≤ eval out1 < m
-//
 func p384Square(out1 *p384MontgomeryDomainFieldElement, arg1 *p384MontgomeryDomainFieldElement) {
        x1 := arg1[1]
        x2 := arg1[2]
@@ -1489,7 +1487,6 @@ func p384Square(out1 *p384MontgomeryDomainFieldElement, arg1 *p384MontgomeryDoma
 // Postconditions:
 //   eval (from_montgomery out1) mod m = (eval (from_montgomery arg1) + eval (from_montgomery arg2)) mod m
 //   0 ≤ eval out1 < m
-//
 func p384Add(out1 *p384MontgomeryDomainFieldElement, arg1 *p384MontgomeryDomainFieldElement, arg2 *p384MontgomeryDomainFieldElement) {
        var x1 uint64
        var x2 uint64
@@ -1557,7 +1554,6 @@ func p384Add(out1 *p384MontgomeryDomainFieldElement, arg1 *p384MontgomeryDomainF
 // Postconditions:
 //   eval (from_montgomery out1) mod m = (eval (from_montgomery arg1) - eval (from_montgomery arg2)) mod m
 //   0 ≤ eval out1 < m
-//
 func p384Sub(out1 *p384MontgomeryDomainFieldElement, arg1 *p384MontgomeryDomainFieldElement, arg2 *p384MontgomeryDomainFieldElement) {
        var x1 uint64
        var x2 uint64
@@ -1609,7 +1605,6 @@ func p384Sub(out1 *p384MontgomeryDomainFieldElement, arg1 *p384MontgomeryDomainF
 // Postconditions:
 //   eval (from_montgomery out1) mod m = 1 mod m
 //   0 ≤ eval out1 < m
-//
 func p384SetOne(out1 *p384MontgomeryDomainFieldElement) {
        out1[0] = 0xffffffff00000001
        out1[1] = 0xffffffff
@@ -1626,7 +1621,6 @@ func p384SetOne(out1 *p384MontgomeryDomainFieldElement) {
 // Postconditions:
 //   eval out1 mod m = (eval arg1 * ((2^64)⁻¹ mod m)^6) mod m
 //   0 ≤ eval out1 < m
-//
 func p384FromMontgomery(out1 *p384NonMontgomeryDomainFieldElement, arg1 *p384MontgomeryDomainFieldElement) {
        x1 := arg1[0]
        var x2 uint64
@@ -2096,7 +2090,6 @@ func p384FromMontgomery(out1 *p384NonMontgomeryDomainFieldElement, arg1 *p384Mon
 // Postconditions:
 //   eval (from_montgomery out1) mod m = eval arg1 mod m
 //   0 ≤ eval out1 < m
-//
 func p384ToMontgomery(out1 *p384MontgomeryDomainFieldElement, arg1 *p384NonMontgomeryDomainFieldElement) {
        x1 := arg1[1]
        x2 := arg1[2]
index 9f4f290f4cae2de70cb802f79b48ce7b702470f5..ea92c948fd5fdf8a19ea82a7f6b9841e6be28ea2 100644 (file)
@@ -78,7 +78,6 @@ func p521CmovznzU64(out1 *uint64, arg1 p521Uint1, arg2 uint64, arg3 uint64) {
 // Postconditions:
 //   eval (from_montgomery out1) mod m = (eval (from_montgomery arg1) * eval (from_montgomery arg2)) mod m
 //   0 ≤ eval out1 < m
-//
 func p521Mul(out1 *p521MontgomeryDomainFieldElement, arg1 *p521MontgomeryDomainFieldElement, arg2 *p521MontgomeryDomainFieldElement) {
        x1 := arg1[1]
        x2 := arg1[2]
@@ -1599,7 +1598,6 @@ func p521Mul(out1 *p521MontgomeryDomainFieldElement, arg1 *p521MontgomeryDomainF
 // Postconditions:
 //   eval (from_montgomery out1) mod m = (eval (from_montgomery arg1) * eval (from_montgomery arg1)) mod m
 //   0 ≤ eval out1 < m
-//
 func p521Square(out1 *p521MontgomeryDomainFieldElement, arg1 *p521MontgomeryDomainFieldElement) {
        x1 := arg1[1]
        x2 := arg1[2]
@@ -3121,7 +3119,6 @@ func p521Square(out1 *p521MontgomeryDomainFieldElement, arg1 *p521MontgomeryDoma
 // Postconditions:
 //   eval (from_montgomery out1) mod m = (eval (from_montgomery arg1) + eval (from_montgomery arg2)) mod m
 //   0 ≤ eval out1 < m
-//
 func p521Add(out1 *p521MontgomeryDomainFieldElement, arg1 *p521MontgomeryDomainFieldElement, arg2 *p521MontgomeryDomainFieldElement) {
        var x1 uint64
        var x2 uint64
@@ -3216,7 +3213,6 @@ func p521Add(out1 *p521MontgomeryDomainFieldElement, arg1 *p521MontgomeryDomainF
 // Postconditions:
 //   eval (from_montgomery out1) mod m = (eval (from_montgomery arg1) - eval (from_montgomery arg2)) mod m
 //   0 ≤ eval out1 < m
-//
 func p521Sub(out1 *p521MontgomeryDomainFieldElement, arg1 *p521MontgomeryDomainFieldElement, arg2 *p521MontgomeryDomainFieldElement) {
        var x1 uint64
        var x2 uint64
@@ -3289,7 +3285,6 @@ func p521Sub(out1 *p521MontgomeryDomainFieldElement, arg1 *p521MontgomeryDomainF
 // Postconditions:
 //   eval (from_montgomery out1) mod m = 1 mod m
 //   0 ≤ eval out1 < m
-//
 func p521SetOne(out1 *p521MontgomeryDomainFieldElement) {
        out1[0] = 0x80000000000000
        out1[1] = uint64(0x0)
@@ -3309,7 +3304,6 @@ func p521SetOne(out1 *p521MontgomeryDomainFieldElement) {
 // Postconditions:
 //   eval out1 mod m = (eval arg1 * ((2^64)⁻¹ mod m)^9) mod m
 //   0 ≤ eval out1 < m
-//
 func p521FromMontgomery(out1 *p521NonMontgomeryDomainFieldElement, arg1 *p521MontgomeryDomainFieldElement) {
        x1 := arg1[0]
        var x2 uint64
@@ -4263,7 +4257,6 @@ func p521FromMontgomery(out1 *p521NonMontgomeryDomainFieldElement, arg1 *p521Mon
 // Postconditions:
 //   eval (from_montgomery out1) mod m = eval arg1 mod m
 //   0 ≤ eval out1 < m
-//
 func p521ToMontgomery(out1 *p521MontgomeryDomainFieldElement, arg1 *p521NonMontgomeryDomainFieldElement) {
        var x1 uint64
        var x2 uint64
index e9a6a067a2258a23e90e8071ba183b699e7fab76..dda1157564ed0a9b22e07254b95fefad58b67496 100644 (file)
@@ -49,7 +49,6 @@ func (curve p256CurveFast) Params() *CurveParams {
 func p256MulAsm(res, in1, in2 []byte)
 
 // Montgomery square modulo P256
-//
 func p256Sqr(res, in []byte) {
        p256MulAsm(res, in, in)
 }
@@ -98,7 +97,6 @@ func p256PointDoubleAsm(res, in *p256Point)
 // The result should be a slice in LE order, but the slice
 // from big.Bytes is in BE order.
 // TODO: For big endian implementation, do not reverse bytes.
-//
 func fromBig(big *big.Int) []byte {
        // This could be done a lot more efficiently...
        res := big.Bytes()
index d164991eec94c1c05f53d837e2bdadcded4c0717..408a820d13219c12791df4296cdd90775b183ae7 100644 (file)
@@ -267,7 +267,6 @@ var cipherSuitesTLS13 = []*cipherSuiteTLS13{ // TODO: replace with a map.
 //
 //       The relative order of ECDSA and RSA cipher suites doesn't matter,
 //       as they depend on the certificate. Pick one to get a stable order.
-//
 var cipherSuitesPreferenceOrder = []uint16{
        // AEADs w/ ECDHE
        TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256, TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256,
index c3b9d1ce466471c2350cc71f89dc7bef3d96d290..d9b40ff53f70b2717e2a83572812fe60a80d2987 100644 (file)
@@ -1174,7 +1174,6 @@ func (rc *rowsCursor) NextResultSet() error {
 // This could be surprising behavior to retroactively apply to
 // driver.String now that Go1 is out, but this is convenient for
 // our TestPointerParamsAndScans.
-//
 type fakeDriverString struct{}
 
 func (fakeDriverString) ConvertValue(v any) (driver.Value, error) {
index d55cee1210971c4292d6cbab9bd95f83a1f68f4e..9a879464d8f1b3afdbbe9889b4ab25c6cd027749 100644 (file)
@@ -184,7 +184,6 @@ type RawBytes []byte
 //  } else {
 //     // NULL value
 //  }
-//
 type NullString struct {
        String string
        Valid  bool // Valid is true if String is not NULL
index 98c17dc08ac1bb5b9f4704c784afde6a342595ba..9f3f4971e18b56dd1a71dc1d40c492cb765e847f 100644 (file)
@@ -381,7 +381,6 @@ func (i Class) GoString() string {
 // A common idiom is to merge the check for nil return with
 // the check that the value has the expected dynamic type, as in:
 //     v, ok := e.Val(AttrSibling).(int64)
-//
 func (e *Entry) Val(a Attr) any {
        if f := e.AttrField(a); f != nil {
                return f.Val
index f1f7af863c33363ec45c17611c5a13252d77f540..1f1fb00ffae75f9998a239d81706bba62a6f8cf4 100644 (file)
@@ -183,7 +183,6 @@ func (e CorruptInputError) Error() string {
 // than wait for the completion of another 32-bit block.
 //
 // NewDecoder wraps an io.Reader interface around Decode.
-//
 func Decode(dst, src []byte, flush bool) (ndst, nsrc int, err error) {
        var v uint32
        var nb int
index 8fe20b5c45d324f34ccf72752849c433a9bc2223..bfb4dd193e8884c0c301b245bd64e96a6d1b2bf7 100644 (file)
@@ -56,7 +56,6 @@ func PutUvarint(buf []byte, x uint64) int {
 //     n == 0: buf too small
 //     n  < 0: value larger than 64 bits (overflow)
 //             and -n is the number of bytes read
-//
 func Uvarint(buf []byte) (uint64, int) {
        var x uint64
        var s uint
@@ -95,7 +94,6 @@ func PutVarint(buf []byte, x int64) int {
 //     n == 0: buf too small
 //     n  < 0: value larger than 64 bits (overflow)
 //             and -n is the number of bytes read
-//
 func Varint(buf []byte) (int64, int) {
        ux, n := Uvarint(buf) // ok to continue in presence of error
        x := int64(ux >> 1)
index 555df0b7e876ad8e4934a2e3dbde4f2ecde96e38..ce9675a62fc159634df7dbbe46bdf1bced546100 100644 (file)
@@ -92,7 +92,6 @@ import (
 // invalid UTF-16 surrogate pairs are not treated as an error.
 // Instead, they are replaced by the Unicode replacement
 // character U+FFFD.
-//
 func Unmarshal(data []byte, v any) error {
        // Check for well-formedness.
        // Avoids filling out half a data structure
index 571ac094e2c477e7d57f2fb431b297ddb6a634c0..fc865386ed37c2735a9c9ca5a77a6d48723c8427 100644 (file)
@@ -154,7 +154,6 @@ import (
 // JSON cannot represent cyclic data structures and Marshal does not
 // handle them. Passing cyclic structures to Marshal will result in
 // an error.
-//
 func Marshal(v any) ([]byte, error) {
        e := newEncodeState()
 
index 6362170d5df229da92b5f1bd6ab6752a41d11285..b278ee4013966f1812dbbd5426939afcc21f32c4 100644 (file)
@@ -287,7 +287,6 @@ var _ Unmarshaler = (*RawMessage)(nil)
 //     Number, for JSON numbers
 //     string, for JSON string literals
 //     nil, for JSON null
-//
 type Token any
 
 const (
index a74a827c8fde6cb7cf6d56ec31a3ef5a298ba6b1..61855359f86b6ad8e8bc10f571d3419c8748785c 100644 (file)
@@ -72,7 +72,6 @@ func (c *Comment) End() token.Pos { return token.Pos(int(c.Slash) + len(c.Text))
 
 // A CommentGroup represents a sequence of comments
 // with no other tokens and no empty lines between.
-//
 type CommentGroup struct {
        List []*Comment // len(List) > 0
 }
@@ -273,7 +272,6 @@ func (f *FieldList) NumFields() int {
 
 // An expression is represented by a tree consisting of one
 // or more of the following concrete expression nodes.
-//
 type (
        // A BadExpr node is a placeholder for an expression containing
        // syntax errors for which a correct expression node cannot be
@@ -417,7 +415,6 @@ type (
 
 // The direction of a channel type is indicated by a bit
 // mask including one or both of the following constants.
-//
 type ChanDir int
 
 const (
@@ -428,7 +425,6 @@ const (
 // A type is represented by a tree consisting of one
 // or more of the following type-specific expression
 // nodes.
-//
 type (
        // An ArrayType node represents an array or slice type.
        ArrayType struct {
@@ -549,7 +545,6 @@ func (x *ChanType) End() token.Pos      { return x.Value.End() }
 
 // exprNode() ensures that only expression/type nodes can be
 // assigned to an Expr.
-//
 func (*BadExpr) exprNode()        {}
 func (*Ident) exprNode()          {}
 func (*Ellipsis) exprNode()       {}
@@ -580,15 +575,12 @@ func (*ChanType) exprNode()      {}
 
 // NewIdent creates a new Ident without position.
 // Useful for ASTs generated by code other than the Go parser.
-//
 func NewIdent(name string) *Ident { return &Ident{token.NoPos, name, nil} }
 
 // IsExported reports whether name starts with an upper-case letter.
-//
 func IsExported(name string) bool { return token.IsExported(name) }
 
 // IsExported reports whether id starts with an upper-case letter.
-//
 func (id *Ident) IsExported() bool { return token.IsExported(id.Name) }
 
 func (id *Ident) String() string {
@@ -603,7 +595,6 @@ func (id *Ident) String() string {
 
 // A statement is represented by a tree consisting of one
 // or more of the following concrete statement nodes.
-//
 type (
        // A BadStmt node is a placeholder for statements containing
        // syntax errors for which no correct statement nodes can be
@@ -854,7 +845,6 @@ func (s *RangeStmt) End() token.Pos  { return s.Body.End() }
 
 // stmtNode() ensures that only statement nodes can be
 // assigned to a Stmt.
-//
 func (*BadStmt) stmtNode()        {}
 func (*DeclStmt) stmtNode()       {}
 func (*EmptyStmt) stmtNode()      {}
@@ -882,7 +872,6 @@ func (*RangeStmt) stmtNode()      {}
 
 // A Spec node represents a single (non-parenthesized) import,
 // constant, type, or variable declaration.
-//
 type (
        // The Spec type stands for any of *ImportSpec, *ValueSpec, and *TypeSpec.
        Spec interface {
@@ -952,13 +941,11 @@ func (s *TypeSpec) End() token.Pos { return s.Type.End() }
 
 // specNode() ensures that only spec nodes can be
 // assigned to a Spec.
-//
 func (*ImportSpec) specNode() {}
 func (*ValueSpec) specNode()  {}
 func (*TypeSpec) specNode()   {}
 
 // A declaration is represented by one of the following declaration nodes.
-//
 type (
        // A BadDecl node is a placeholder for a declaration containing
        // syntax errors for which a correct declaration node cannot be
@@ -1020,7 +1007,6 @@ func (d *FuncDecl) End() token.Pos {
 
 // declNode() ensures that only declaration nodes can be
 // assigned to a Decl.
-//
 func (*BadDecl) declNode()  {}
 func (*GenDecl) declNode()  {}
 func (*FuncDecl) declNode() {}
@@ -1046,7 +1032,6 @@ func (*FuncDecl) declNode() {}
 // interpretation of the syntax tree by the manipulating program: Except for Doc
 // and Comment comments directly associated with nodes, the remaining comments
 // are "free-floating" (see also issues #18593, #20744).
-//
 type File struct {
        Doc        *CommentGroup   // associated documentation; or nil
        Package    token.Pos       // position of "package" keyword
@@ -1068,7 +1053,6 @@ func (f *File) End() token.Pos {
 
 // A Package node represents a set of source files
 // collectively building a Go package.
-//
 type Package struct {
        Name    string             // package name
        Scope   *Scope             // package scope across all files
index 5161ea70b7640d088e918a5299c61bea7d313717..9f81493f64219b9c0f7504ecb4d255acbfeae8bf 100644 (file)
@@ -18,7 +18,6 @@ func (a byPos) Less(i, j int) bool { return a[i].Pos() < a[j].Pos() }
 func (a byPos) Swap(i, j int)      { a[i], a[j] = a[j], a[i] }
 
 // sortComments sorts the list of comment groups in source order.
-//
 func sortComments(list []*CommentGroup) {
        // TODO(gri): Does it make sense to check for sorted-ness
        //            first (because we know that sorted-ness is
@@ -31,7 +30,6 @@ func sortComments(list []*CommentGroup) {
 // A CommentMap maps an AST node to a list of comment groups
 // associated with it. See NewCommentMap for a description of
 // the association.
-//
 type CommentMap map[Node][]*CommentGroup
 
 func (cmap CommentMap) addComment(n Node, c *CommentGroup) {
@@ -54,7 +52,6 @@ func (a byInterval) Less(i, j int) bool {
 func (a byInterval) Swap(i, j int) { a[i], a[j] = a[j], a[i] }
 
 // nodeList returns the list of nodes of the AST n in source order.
-//
 func nodeList(n Node) []Node {
        var list []Node
        Inspect(n, func(n Node) bool {
@@ -75,7 +72,6 @@ func nodeList(n Node) []Node {
 }
 
 // A commentListReader helps iterating through a list of comment groups.
-//
 type commentListReader struct {
        fset     *token.FileSet
        list     []*CommentGroup
@@ -99,12 +95,10 @@ func (r *commentListReader) next() {
 
 // A nodeStack keeps track of nested nodes.
 // A node lower on the stack lexically contains the nodes higher on the stack.
-//
 type nodeStack []Node
 
 // push pops all nodes that appear lexically before n
 // and then pushes n on the stack.
-//
 func (s *nodeStack) push(n Node) {
        s.pop(n.Pos())
        *s = append((*s), n)
@@ -113,7 +107,6 @@ func (s *nodeStack) push(n Node) {
 // pop pops all nodes that appear lexically before pos
 // (i.e., whose lexical extent has ended before or at pos).
 // It returns the last node popped.
-//
 func (s *nodeStack) pop(pos token.Pos) (top Node) {
        i := len(*s)
        for i > 0 && (*s)[i-1].End() <= pos {
@@ -139,7 +132,6 @@ func (s *nodeStack) pop(pos token.Pos) (top Node) {
 // node possible: For instance, if the comment is a line comment
 // trailing an assignment, the comment is associated with the entire
 // assignment rather than just the last operand in the assignment.
-//
 func NewCommentMap(fset *token.FileSet, node Node, comments []*CommentGroup) CommentMap {
        if len(comments) == 0 {
                return nil // no comments to map
@@ -242,7 +234,6 @@ func NewCommentMap(fset *token.FileSet, node Node, comments []*CommentGroup) Com
 // Update replaces an old node in the comment map with the new node
 // and returns the new node. Comments that were associated with the
 // old node are associated with the new node.
-//
 func (cmap CommentMap) Update(old, new Node) Node {
        if list := cmap[old]; len(list) > 0 {
                delete(cmap, old)
@@ -254,7 +245,6 @@ func (cmap CommentMap) Update(old, new Node) Node {
 // Filter returns a new comment map consisting of only those
 // entries of cmap for which a corresponding node exists in
 // the AST specified by node.
-//
 func (cmap CommentMap) Filter(node Node) CommentMap {
        umap := make(CommentMap)
        Inspect(node, func(n Node) bool {
@@ -268,7 +258,6 @@ func (cmap CommentMap) Filter(node Node) CommentMap {
 
 // Comments returns the list of comment groups in the comment map.
 // The result is sorted in source order.
-//
 func (cmap CommentMap) Comments() []*CommentGroup {
        list := make([]*CommentGroup, 0, len(cmap))
        for _, e := range cmap {
index 38c62b01ab92d3e6b845f433257d2ab6807126ba..281467c41f307454a01ca2786768c17e43aced07 100644 (file)
@@ -73,7 +73,6 @@ func f3() {
 
 // res maps a key of the form "line number: node type"
 // to the associated comments' text.
-//
 var res = map[string]string{
        " 5: *ast.File":       "the very first comment\npackage p\n",
        " 5: *ast.Ident":      " the name is p\n",
index c398e6e603a480a94545abc975f453c710a03215..2fc73c4b99420bb7b88b49c8d7c5d43632c3c747 100644 (file)
@@ -24,7 +24,6 @@ func exportFilter(name string) bool {
 // stripped. The File.Comments list is not changed.
 //
 // FileExports reports whether there are exported declarations.
-//
 func FileExports(src *File) bool {
        return filterFile(src, exportFilter, true)
 }
@@ -35,7 +34,6 @@ func FileExports(src *File) bool {
 //
 // PackageExports reports whether there are exported declarations;
 // it returns false otherwise.
-//
 func PackageExports(pkg *Package) bool {
        return filterPackage(pkg, exportFilter, true)
 }
@@ -59,7 +57,6 @@ func filterIdentList(list []*Ident, f Filter) []*Ident {
 // fieldName assumes that x is the type of an anonymous field and
 // returns the corresponding field name. If x is not an acceptable
 // anonymous field, the result is nil.
-//
 func fieldName(x Expr) *Ident {
        switch t := x.(type) {
        case *Ident:
@@ -229,7 +226,6 @@ func filterSpecList(list []Spec, f Filter, export bool) []Spec {
 //
 // FilterDecl reports whether there are any declared names left after
 // filtering.
-//
 func FilterDecl(decl Decl, f Filter) bool {
        return filterDecl(decl, f, false)
 }
@@ -254,7 +250,6 @@ func filterDecl(decl Decl, f Filter, export bool) bool {
 //
 // FilterFile reports whether there are any top-level declarations
 // left after filtering.
-//
 func FilterFile(src *File, f Filter) bool {
        return filterFile(src, f, false)
 }
@@ -281,7 +276,6 @@ func filterFile(src *File, f Filter, export bool) bool {
 //
 // FilterPackage reports whether there are any top-level declarations
 // left after filtering.
-//
 func FilterPackage(pkg *Package, f Filter) bool {
        return filterPackage(pkg, f, false)
 }
@@ -315,7 +309,6 @@ const (
 // nameOf returns the function (foo) or method name (foo.bar) for
 // the given function declaration. If the AST is incorrect for the
 // receiver, it assumes a function instead.
-//
 func nameOf(f *FuncDecl) string {
        if r := f.Recv; r != nil && len(r.List) == 1 {
                // looks like a correct receiver declaration
@@ -335,12 +328,10 @@ func nameOf(f *FuncDecl) string {
 
 // separator is an empty //-style comment that is interspersed between
 // different comment groups when they are concatenated into a single group
-//
 var separator = &Comment{token.NoPos, "//"}
 
 // MergePackageFiles creates a file AST by merging the ASTs of the
 // files belonging to a package. The mode flags control merging behavior.
-//
 func MergePackageFiles(pkg *Package, mode MergeMode) *File {
        // Count the number of package docs, comments and declarations across
        // all package files. Also, compute sorted list of filenames, so that
index 9fd86cb46710ee3fbfb80c9b569a6ea8e9217b72..86f396bb8be897cbf6c929eaad5f9a03906f6b72 100644 (file)
@@ -38,7 +38,6 @@ func (x *t2) f2() {}
 // of one without, and it favors duplicate entries appearing
 // later in the source over ones appearing earlier. This is why
 // (*t2).f2 is kept and t2.f2 is eliminated in this test case.
-//
 const golden = `package p
 
 type t1 struct{}
index 126a27b18cdd97d350eb4eeadfd581dfd12f914e..970aa88ad69dc14c5191d092e430083b26523fce 100644 (file)
@@ -70,7 +70,6 @@ type Importer func(imports map[string]*Object, path string) (pkg *Object, err er
 // belong to different packages, one package name is selected and files with
 // different package names are reported and then ignored.
 // The result is a package node and a scanner.ErrorList if there were errors.
-//
 func NewPackage(fset *token.FileSet, files map[string]*File, importer Importer, universe *Scope) (*Package, error) {
        var p pkgBuilder
        p.fset = fset
index d24a5f0e002fd14a1657e6d1426e7cafafdf0612..02691f8e5462c34f519bda27b3c965e0a4ee2d51 100644 (file)
@@ -15,7 +15,6 @@ import (
 // A Scope maintains the set of named language entities declared
 // in the scope and a link to the immediately surrounding (outer)
 // scope.
-//
 type Scope struct {
        Outer   *Scope
        Objects map[string]*Object
@@ -30,7 +29,6 @@ func NewScope(outer *Scope) *Scope {
 // Lookup returns the object with the given name if it is
 // found in scope s, otherwise it returns nil. Outer scopes
 // are ignored.
-//
 func (s *Scope) Lookup(name string) *Object {
        return s.Objects[name]
 }
@@ -39,7 +37,6 @@ func (s *Scope) Lookup(name string) *Object {
 // If the scope already contains an object alt with the same name,
 // Insert leaves the scope unchanged and returns alt. Otherwise
 // it inserts obj and returns nil.
-//
 func (s *Scope) Insert(obj *Object) (alt *Object) {
        if alt = s.Objects[obj.Name]; alt == nil {
                s.Objects[obj.Name] = obj
@@ -72,7 +69,6 @@ func (s *Scope) String() string {
 //     Kind    Data type         Data value
 //     Pkg     *Scope            package scope
 //     Con     int               iota for the respective declaration
-//
 type Object struct {
        Kind ObjKind
        Name string // declared name
index 16b15f11f2f8c715fde5d800c433adb7cf5b0f0d..a293c99a105b70213169122b04a7f901c55a0052 100644 (file)
@@ -47,7 +47,6 @@ func walkDeclList(v Visitor, list []Decl) {
 // v.Visit(node) is not nil, Walk is invoked recursively with visitor
 // w for each of the non-nil children of node, followed by a call of
 // w.Visit(nil).
-//
 func Walk(v Visitor, node Node) {
        if v = v.Visit(node); v == nil {
                return
@@ -394,7 +393,6 @@ func (f inspector) Visit(node Node) Visitor {
 // f(node); node must not be nil. If f returns true, Inspect invokes f
 // recursively for each of the non-nil children of node, followed by a
 // call of f(nil).
-//
 func Inspect(node Node, f func(Node) bool) {
        Walk(inspector(f), node)
 }
index cc2585b6773efcae7ddb69d3a2099cf224bd745c..2666b8acb78c83abc7862f6c996d41c0ffdbe12f 100644 (file)
@@ -534,7 +534,6 @@ func nameExt(name string) string {
 //
 // If an error occurs, Import returns a non-nil error and a non-nil
 // *Package containing partial information.
-//
 func (ctxt *Context) Import(path string, srcDir string, mode ImportMode) (*Package, error) {
        p := &Package{
                ImportPath: path,
@@ -1813,7 +1812,6 @@ func safeCgoName(s string) bool {
 // 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))
index 5794e3d25e9db50b3230996f61145348b2a1fc94..c4fb2fe0b4e5bdb6a1a205478b01d0e727c96e97 100644 (file)
@@ -66,7 +66,6 @@ import (
 //
 // All-caps names are pseudo-names for specific points
 // in the dependency lattice.
-//
 var depsRules = `
        # No dependencies allowed for any of these packages.
        NONE
index 544801bd70caae94c6dc4a7f8ecdaf71bc8af6d3..3daa4c2860826a37d713879859669a9379fb4e10 100644 (file)
@@ -578,7 +578,6 @@ func Float64Val(x Value) (float64, bool) {
 //    Int                int64 or *big.Int
 //    Float              *big.Float or *big.Rat
 //    everything else    nil
-//
 func Val(x Value) any {
        switch x := x.(type) {
        case boolVal:
@@ -609,7 +608,6 @@ func Val(x Value) any {
 //    *big.Float       Float
 //    *big.Rat         Float
 //    anything else    Unknown
-//
 func Make(x any) Value {
        switch x := x.(type) {
        case bool:
@@ -945,7 +943,6 @@ func is63bit(x int64) bool {
 // The operation must be defined for the operand.
 // If prec > 0 it specifies the ^ (xor) result size in bits.
 // If y is Unknown, the result is Unknown.
-//
 func UnaryOp(op token.Token, y Value, prec uint) Value {
        switch op {
        case token.ADD:
@@ -1035,7 +1032,6 @@ func ord(x Value) int {
 // smallest complexity for two values x and y. If one of them is
 // numeric, both of them must be numeric. If one of them is Unknown
 // or invalid (say, nil) both results are that value.
-//
 func match(x, y Value) (_, _ Value) {
        switch ox, oy := ord(x), ord(y); {
        case ox < oy:
@@ -1092,7 +1088,6 @@ func match0(x, y Value) (_, _ Value) {
 // To force integer division of Int operands, use op == token.QUO_ASSIGN
 // instead of token.QUO; the result is guaranteed to be Int in this case.
 // Division by zero leads to a run-time panic.
-//
 func BinaryOp(x_ Value, op token.Token, y_ Value) Value {
        x, y := match(x_, y_)
 
@@ -1272,7 +1267,6 @@ func quo(x, y Value) Value { return BinaryOp(x, token.QUO, y) }
 // Shift returns the result of the shift expression x op s
 // with op == token.SHL or token.SHR (<< or >>). x must be
 // an Int or an Unknown. If x is Unknown, the result is x.
-//
 func Shift(x Value, op token.Token, s uint) Value {
        switch x := x.(type) {
        case unknownVal:
@@ -1328,7 +1322,6 @@ func cmpZero(x int, op token.Token) bool {
 // The comparison must be defined for the operands.
 // If one of the operands is Unknown, the result is
 // false.
-//
 func Compare(x_ Value, op token.Token, y_ Value) bool {
        x, y := match(x_, y_)
 
index 5ab854d084b66f2ec45b87c70c72bef12ab9365d..f0c1b5dd32713c8715ee8180bbc468309c302d78 100644 (file)
@@ -114,7 +114,6 @@ const (
 // New takes ownership of the AST pkg and may edit or overwrite it.
 // To have the Examples fields populated, use NewFromFiles and include
 // the package's _test.go files.
-//
 func New(pkg *ast.Package, importPath string, mode Mode) *Package {
        var r reader
        r.readPackage(pkg, mode)
@@ -156,7 +155,6 @@ func New(pkg *ast.Package, importPath string, mode Mode) *Package {
 //
 // NewFromFiles takes ownership of the AST files and may edit them,
 // unless the PreserveAST Mode bit is on.
-//
 func NewFromFiles(fset *token.FileSet, files []*ast.File, importPath string, opts ...any) (*Package, error) {
        // Check for invalid API usage.
        if fset == nil {
index 0a880cdefb617462b49ca7262af681caa72f955a..fcd59e100abad8c9e97a0864d0121c443b368ace 100644 (file)
@@ -462,7 +462,6 @@ func lastComment(b *ast.BlockStmt, c []*ast.CommentGroup) (i int, last *ast.Comm
 //       or Foo (with a "bar" suffix).
 //
 // Examples with malformed names are not associated with anything.
-//
 func classifyExamples(p *Package, examples []*Example) {
        if len(examples) == 0 {
                return
index 671c622205b2d4d96127421a2cf7bb7b17d9784e..655e889293ea4d5d0f64dc64fbfc9bdd6d34b2f1 100644 (file)
@@ -13,7 +13,6 @@ import (
 
 // filterIdentList removes unexported names from list in place
 // and returns the resulting list.
-//
 func filterIdentList(list []*ast.Ident) []*ast.Ident {
        j := 0
        for _, x := range list {
@@ -69,7 +68,6 @@ func updateIdentList(list []*ast.Ident) (hasExported bool) {
 }
 
 // hasExportedName reports whether list contains any exported names.
-//
 func hasExportedName(list []*ast.Ident) bool {
        for _, x := range list {
                if x.IsExported() {
@@ -106,7 +104,6 @@ func removeAnonymousField(name string, ityp *ast.InterfaceType) {
 // in place and reports whether fields were removed. Anonymous fields are
 // recorded with the parent type. filterType is called with the types of
 // all remaining fields.
-//
 func (r *reader) filterFieldList(parent *namedType, fields *ast.FieldList, ityp *ast.InterfaceType) (removedFields bool) {
        if fields == nil {
                return
@@ -159,7 +156,6 @@ func (r *reader) filterFieldList(parent *namedType, fields *ast.FieldList, ityp
 }
 
 // filterParamList applies filterType to each parameter type in fields.
-//
 func (r *reader) filterParamList(fields *ast.FieldList) {
        if fields != nil {
                for _, f := range fields.List {
@@ -171,7 +167,6 @@ func (r *reader) filterParamList(fields *ast.FieldList) {
 // filterType strips any unexported struct fields or method types from typ
 // in place. If fields (or methods) have been removed, the corresponding
 // struct or interface type has the Incomplete field set to true.
-//
 func (r *reader) filterType(parent *namedType, typ ast.Expr) {
        switch t := typ.(type) {
        case *ast.Ident:
@@ -255,7 +250,6 @@ func (r *reader) filterSpec(spec ast.Spec) bool {
 // copyConstType returns a copy of typ with position pos.
 // typ must be a valid constant type.
 // In practice, only (possibly qualified) identifiers are possible.
-//
 func copyConstType(typ ast.Expr, pos token.Pos) ast.Expr {
        switch typ := typ.(type) {
        case *ast.Ident:
@@ -318,7 +312,6 @@ func (r *reader) filterDecl(decl ast.Decl) bool {
 }
 
 // fileExports removes unexported declarations from src in place.
-//
 func (r *reader) fileExports(src *ast.File) {
        j := 0
        for _, d := range src.Decls {
index 9904da150e96ac4052794fb6c16124633a9160dc..f8d3e1fca23dfabbf23edf7b9721afb75a16cb0d 100644 (file)
@@ -97,7 +97,6 @@ func filterTypes(a []*Type, f Filter) []*Type {
 
 // Filter eliminates documentation for names that don't pass through the filter f.
 // TODO(gri): Recognize "Type.Method" as a name.
-//
 func (p *Package) Filter(f Filter) {
        p.Consts = filterValues(p.Consts, f)
        p.Vars = filterValues(p.Vars, f)
index d9e721d01b001deb0e25d8d584da41f0acd4016e..c591059e5c878d8b678088540c97d4d3c7c52de7 100644 (file)
@@ -21,12 +21,10 @@ import (
 
 // A methodSet describes a set of methods. Entries where Decl == nil are conflict
 // entries (more than one method with the same name at the same embedding level).
-//
 type methodSet map[string]*Func
 
 // recvString returns a string representation of recv of the form "T", "*T",
 // "T[A, ...]", "*T[A, ...]" or "BADRECV" (if not a proper receiver type).
-//
 func recvString(recv ast.Expr) string {
        switch t := recv.(type) {
        case *ast.Ident:
@@ -65,7 +63,6 @@ func recvParam(p ast.Expr) string {
 // If there are multiple f's with the same name, set keeps the first
 // one with documentation; conflicts are ignored. The boolean
 // specifies whether to leave the AST untouched.
-//
 func (mset methodSet) set(f *ast.FuncDecl, preserveAST bool) {
        name := f.Name.Name
        if g := mset[name]; g != nil && g.Doc != "" {
@@ -101,7 +98,6 @@ func (mset methodSet) set(f *ast.FuncDecl, preserveAST bool) {
 // add adds method m to the method set; m is ignored if the method set
 // already contains a method with the same name at the same or a higher
 // level than m.
-//
 func (mset methodSet) add(m *Func) {
        old := mset[m.Name]
        if old == nil || m.Level < old.Level {
@@ -122,7 +118,6 @@ func (mset methodSet) add(m *Func) {
 
 // baseTypeName returns the name of the base type of x (or "")
 // and whether the type is imported or not.
-//
 func baseTypeName(x ast.Expr) (name string, imported bool) {
        switch t := x.(type) {
        case *ast.Ident:
@@ -151,7 +146,6 @@ type embeddedSet map[*namedType]bool
 // A namedType represents a named unqualified (package local, or possibly
 // predeclared) type. The namedType for a type name is always found via
 // reader.lookupType.
-//
 type namedType struct {
        doc  string       // doc comment for type
        name string       // type name
@@ -176,7 +170,6 @@ type namedType struct {
 // in the respective AST nodes so that they are not printed
 // twice (once when printing the documentation and once when
 // printing the corresponding AST node).
-//
 type reader struct {
        mode Mode
 
@@ -206,7 +199,6 @@ func (r *reader) isVisible(name string) bool {
 // If the base type has not been encountered yet, a new
 // type with the given name but no associated declaration
 // is added to the type map.
-//
 func (r *reader) lookupType(name string) *namedType {
        if name == "" || name == "_" {
                return nil // no type docs for anonymous types
@@ -229,7 +221,6 @@ func (r *reader) lookupType(name string) *namedType {
 // anonymous field in the parent type. If the field is imported
 // (qualified name) or the parent is nil, the field is ignored.
 // The function returns the field name.
-//
 func (r *reader) recordAnonymousField(parent *namedType, fieldType ast.Expr) (fname string) {
        fname, imp := baseTypeName(fieldType)
        if parent == nil || imp {
@@ -273,7 +264,6 @@ func specNames(specs []ast.Spec) []string {
 }
 
 // readValue processes a const or var declaration.
-//
 func (r *reader) readValue(decl *ast.GenDecl) {
        // determine if decl should be associated with a type
        // Heuristic: For each typed entry, determine the type name, if any.
@@ -347,7 +337,6 @@ func (r *reader) readValue(decl *ast.GenDecl) {
 }
 
 // fields returns a struct's fields or an interface's methods.
-//
 func fields(typ ast.Expr) (list []*ast.Field, isStruct bool) {
        var fields *ast.FieldList
        switch t := typ.(type) {
@@ -364,7 +353,6 @@ func fields(typ ast.Expr) (list []*ast.Field, isStruct bool) {
 }
 
 // readType processes a type declaration.
-//
 func (r *reader) readType(decl *ast.GenDecl, spec *ast.TypeSpec) {
        typ := r.lookupType(spec.Name.Name)
        if typ == nil {
@@ -400,13 +388,11 @@ func (r *reader) readType(decl *ast.GenDecl, spec *ast.TypeSpec) {
 }
 
 // isPredeclared reports whether n denotes a predeclared type.
-//
 func (r *reader) isPredeclared(n string) bool {
        return predeclaredTypes[n] && r.types[n] == nil
 }
 
 // readFunc processes a func or method declaration.
-//
 func (r *reader) readFunc(fun *ast.FuncDecl) {
        // strip function body if requested.
        if r.mode&PreserveAST == 0 {
@@ -500,7 +486,6 @@ var (
 )
 
 // readNote collects a single note from a sequence of comments.
-//
 func (r *reader) readNote(list []*ast.Comment) {
        text := (&ast.CommentGroup{List: list}).Text()
        if m := noteMarkerRx.FindStringSubmatchIndex(text); m != nil {
@@ -526,7 +511,6 @@ func (r *reader) readNote(list []*ast.Comment) {
 // and is followed by the note body (e.g., "// BUG(gri): fix this").
 // The note ends at the end of the comment group or at the start of
 // another note in the same comment group, whichever comes first.
-//
 func (r *reader) readNotes(comments []*ast.CommentGroup) {
        for _, group := range comments {
                i := -1 // comment index of most recent note start, valid if >= 0
@@ -546,7 +530,6 @@ func (r *reader) readNotes(comments []*ast.CommentGroup) {
 }
 
 // readFile adds the AST for a source file to the reader.
-//
 func (r *reader) readFile(src *ast.File) {
        // add package documentation
        if src.Doc != nil {
@@ -696,7 +679,6 @@ func customizeRecv(f *Func, recvTypeName string, embeddedIsPtr bool, level int)
 }
 
 // collectEmbeddedMethods collects the embedded methods of typ in mset.
-//
 func (r *reader) collectEmbeddedMethods(mset methodSet, typ *namedType, recvTypeName string, embeddedIsPtr bool, level int, visited embeddedSet) {
        visited[typ] = true
        for embedded, isPtr := range typ.embedded {
@@ -720,7 +702,6 @@ func (r *reader) collectEmbeddedMethods(mset methodSet, typ *namedType, recvType
 }
 
 // computeMethodSets determines the actual method sets for each type encountered.
-//
 func (r *reader) computeMethodSets() {
        for _, t := range r.types {
                // collect embedded methods for t
@@ -746,7 +727,6 @@ func (r *reader) computeMethodSets() {
 // types that have no declaration. Instead, these functions and methods
 // are shown at the package level. It also removes types with missing
 // declarations or which are not visible.
-//
 func (r *reader) cleanupTypes() {
        for _, t := range r.types {
                visible := r.isVisible(t.name)
@@ -813,7 +793,6 @@ func sortedKeys(m map[string]int) []string {
 }
 
 // sortingName returns the name to use when sorting d into place.
-//
 func sortingName(d *ast.GenDecl) string {
        if len(d.Specs) == 1 {
                if s, ok := d.Specs[0].(*ast.ValueSpec); ok {
@@ -906,7 +885,6 @@ func sortedFuncs(m methodSet, allMethods bool) []*Func {
 
 // noteBodies returns a list of note body strings given a list of notes.
 // This is only used to populate the deprecated Package.Bugs field.
-//
 func noteBodies(notes []*Note) []string {
        var list []string
        for _, n := range notes {
index 3fa1616cd147b19af5d87884dcd22a140c73846c..ca607cc4e568d2beb63b217a34cb3540b5bcada2 100644 (file)
@@ -12,7 +12,6 @@ import (
 // firstSentenceLen returns the length of the first sentence in s.
 // The sentence ends after the first period followed by space and
 // not preceded by exactly one uppercase letter.
-//
 func firstSentenceLen(s string) int {
        var ppp, pp, p rune
        for i, q := range s {
@@ -64,7 +63,6 @@ func clean(s string, flags int) string {
 // has no \n, \r, or \t characters and uses only single spaces between
 // words. If s starts with any of the IllegalPrefixes, the result
 // is the empty string.
-//
 func Synopsis(s string) string {
        s = clean(s[0:firstSentenceLen(s)], 0)
        for _, prefix := range IllegalPrefixes {
index ac19aa3bf5d59d8164094440782c9d5cbeb774f9..d434d6f5493903dc5fba57c30b8a3622d2b530e6 100644 (file)
@@ -31,7 +31,6 @@ var debug = flag.Bool("debug", false, "write .src files containing formatting in
 //     0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f,
 //     0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37,
 //     ...
-//
 func array1(buf *bytes.Buffer, n int) {
        buf.WriteString("var _ = [...]byte{\n")
        for i := 0; i < n; {
index ea8dd208238cc2571adcf9505f88f641e793af69..fb87e84a4eb25febf8fe80b09014085c4d7b5e5e 100644 (file)
@@ -50,7 +50,6 @@ const parserMode = parser.ParseComments
 //
 // The function may return early (before the entire result is written)
 // and return a formatting error, for instance due to an incorrect AST.
-//
 func Node(dst io.Writer, fset *token.FileSet, node any) error {
        // Determine if we have a complete source file (file != nil).
        var file *ast.File
@@ -99,7 +98,6 @@ func Node(dst io.Writer, fset *token.FileSet, node any) error {
 // is applied to the result (such that it has the same leading and trailing
 // space as src), and the result is indented by the same amount as the first
 // line of src containing code. Imports are not sorted for partial source files.
-//
 func Source(src []byte) ([]byte, error) {
        fset := token.NewFileSet()
        file, sourceAdj, indentAdj, err := parse(fset, "", src, true)
index 48335fa6d8fdbd034cfb20156d12e641e699f596..10402fe43e66906bde9bce46cd9ec0e68bdca536 100644 (file)
@@ -187,7 +187,6 @@ func (p *parser) parseQualifiedNameStr(unquotedName string) (pkgpath, name strin
 // getPkg returns the package for a given path. If the package is
 // not found but we have a package name, create the package and
 // add it to the p.imports map.
-//
 func (p *parser) getPkg(pkgpath, name string) *types.Package {
        // package unsafe is not in the imports map - handle explicitly
        if pkgpath == "unsafe" {
@@ -934,7 +933,6 @@ func lookupBuiltinType(typ int) types.Type {
 // Type = "<" "type" ( "-" int | int [ TypeSpec ] ) ">" .
 //
 // parseType updates the type map to t for all type numbers n.
-//
 func (p *parser) parseType(pkg *types.Package, n ...any) types.Type {
        p.expect('<')
        t, _ := p.parseTypeAfterAngle(pkg, n...)
index c12e459c3db1b937f8b8890300029c490b28b83f..43e505b47bcfd19e0eb0611a7fbf976009ed6b9d 100644 (file)
@@ -40,7 +40,6 @@ func readGopackHeader(r *bufio.Reader) (name string, size int, err error) {
 // file by reading from it. The reader must be positioned at the
 // start of the file before calling this function. The hdr result
 // is the string before the export data, either "$$" or "$$B".
-//
 func FindExportData(r *bufio.Reader) (hdr string, err error) {
        // Read first line to make sure this is an object file.
        line, err := r.ReadSlice('\n')
index 73cf6334fd65e681aafe7d97b986de0b5dd8ed29..9ed5e0c5e8c0457d6237cc3ab6f98b79bcf8bb81 100644 (file)
@@ -27,7 +27,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
@@ -83,7 +82,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(fset *token.FileSet, packages map[string]*types.Package, path, srcDir string, lookup func(path string) (io.ReadCloser, error)) (pkg *types.Package, err error) {
        var rc io.ReadCloser
        var id string
index bedfc265b58f53e16b063adc5fd939297f2e50cf..c3a8ec6ad869db9e9dd89a3bc955d7b8923e7ef2 100644 (file)
@@ -64,12 +64,10 @@ func getPos(fset *token.FileSet, filename string, offset int) token.Pos {
 // The special form /* ERROR HERE "rx" */ must be used for error
 // messages that appear immediately after a token, rather than at
 // a token's position.
-//
 var errRx = regexp.MustCompile(`^/\* *ERROR *(HERE)? *"([^"]*)" *\*/$`)
 
 // expectedErrors collects the regular expressions of ERROR comments found
 // in files and returns them as a map of error positions to error messages.
-//
 func expectedErrors(fset *token.FileSet, filename string, src []byte) map[token.Pos]string {
        errors := make(map[token.Pos]string)
 
@@ -116,7 +114,6 @@ func expectedErrors(fset *token.FileSet, filename string, src []byte) map[token.
 
 // compareErrors compares the map of expected error messages with the list
 // of found errors and reports discrepancies.
-//
 func compareErrors(t *testing.T, fset *token.FileSet, expected map[token.Pos]string, found scanner.ErrorList) {
        t.Helper()
        for _, error := range found {
index e4f8c281ea734e80feac4111581fb6a72f7f9c5f..e3468f481fcad1198eaf16490406fc9c9ed99a79 100644 (file)
@@ -21,7 +21,6 @@ import (
 // If src != nil, readSource converts src to a []byte if possible;
 // otherwise it returns an error. If src == nil, readSource returns
 // the result of reading the file specified by filename.
-//
 func readSource(filename string, src any) ([]byte, error) {
        if src != nil {
                switch s := src.(type) {
@@ -45,7 +44,6 @@ func readSource(filename string, src any) ([]byte, error) {
 // A Mode value is a set of flags (or 0).
 // They control the amount of source code parsed and other optional
 // parser functionality.
-//
 type Mode uint
 
 const (
@@ -81,7 +79,6 @@ const (
 // errors were found, the result is a partial AST (with ast.Bad* nodes
 // representing the fragments of erroneous source code). Multiple errors
 // are returned via a scanner.ErrorList which is sorted by source position.
-//
 func ParseFile(fset *token.FileSet, filename string, src any, mode Mode) (f *ast.File, err error) {
        if fset == nil {
                panic("parser.ParseFile: no token.FileSet provided (fset == nil)")
@@ -136,7 +133,6 @@ func ParseFile(fset *token.FileSet, filename string, src any, mode Mode) (f *ast
 // If the directory couldn't be read, a nil map and the respective error are
 // returned. If a parse error occurred, a non-nil but incomplete map and the
 // first error encountered are returned.
-//
 func ParseDir(fset *token.FileSet, path string, filter func(fs.FileInfo) bool, mode Mode) (pkgs map[string]*ast.Package, first error) {
        list, err := os.ReadDir(path)
        if err != nil {
@@ -187,7 +183,6 @@ func ParseDir(fset *token.FileSet, path string, filter func(fs.FileInfo) bool, m
 // errors were found, the result is a partial AST (with ast.Bad* nodes
 // representing the fragments of erroneous source code). Multiple errors
 // are returned via a scanner.ErrorList which is sorted by source position.
-//
 func ParseExprFrom(fset *token.FileSet, filename string, src any, mode Mode) (expr ast.Expr, err error) {
        if fset == nil {
                panic("parser.ParseExprFrom: no token.FileSet provided (fset == nil)")
@@ -232,7 +227,6 @@ func ParseExprFrom(fset *token.FileSet, filename string, src any, mode Mode) (ex
 // If syntax errors were found, the result is a partial AST (with ast.Bad* nodes
 // representing the fragments of erroneous source code). Multiple errors are
 // returned via a scanner.ErrorList which is sorted by source position.
-//
 func ParseExpr(x string) (ast.Expr, error) {
        return ParseExprFrom(token.NewFileSet(), "", []byte(x), 0)
 }
index 51a3c3e67f9d8dbe9733a449c96f6475715530fe..3eb00e944648420e41a9d0ab2309375bff19fec8 100644 (file)
@@ -154,7 +154,6 @@ func (p *parser) consumeComment() (comment *ast.Comment, endline int) {
 // comments list, and return it together with the line at which
 // the last comment in the group ends. A non-comment token or n
 // empty lines terminate a comment group.
-//
 func (p *parser) consumeCommentGroup(n int) (comments *ast.CommentGroup, endline int) {
        var list []*ast.Comment
        endline = p.file.Line(p.pos)
@@ -185,7 +184,6 @@ func (p *parser) consumeCommentGroup(n int) (comments *ast.CommentGroup, endline
 //
 // Lead and line comments may be considered documentation that is
 // stored in the AST.
-//
 func (p *parser) next() {
        p.leadComment = nil
        p.lineComment = nil
@@ -288,7 +286,6 @@ func (p *parser) expect2(tok token.Token) (pos token.Pos) {
 
 // expectClosing is like expect but provides a better error message
 // for the common case of a missing comma before a newline.
-//
 func (p *parser) expectClosing(tok token.Token, context string) token.Pos {
        if p.tok != tok && p.tok == token.SEMICOLON && p.lit == "\n" {
                p.error(p.pos, "missing ',' before newline in "+context)
@@ -406,7 +403,6 @@ var exprEnd = map[token.Token]bool{
 // token positions are invalid due to parse errors, the resulting end position
 // may be past the file's EOF position, which would lead to panics if used
 // later on.
-//
 func (p *parser) safePos(pos token.Pos) (res token.Pos) {
        defer func() {
                if recover() != nil {
@@ -1349,7 +1345,6 @@ func (p *parser) parseFuncTypeOrLit() ast.Expr {
 
 // parseOperand may return an expression or a raw type (incl. array
 // types of the form [...]T. Callers must verify the result.
-//
 func (p *parser) parseOperand() ast.Expr {
        if p.trace {
                defer un(trace(p, "Operand"))
@@ -1640,7 +1635,6 @@ func unparen(x ast.Expr) ast.Expr {
 
 // checkExprOrType checks that x is an expression or a type
 // (and not a raw type such as [...]T).
-//
 func (p *parser) checkExprOrType(x ast.Expr) ast.Expr {
        switch t := unparen(x).(type) {
        case *ast.ParenExpr:
index d66a194c12bb0b589050583121e8956f5a22e6e2..767a5e20ad82ebfff720dd2bd299e62a53bd0a78 100644 (file)
@@ -188,7 +188,6 @@ var unresolved = new(ast.Object)
 // the object it denotes. If no object is found and collectUnresolved is
 // set, x is marked as unresolved and collected in the list of unresolved
 // identifiers.
-//
 func (r *resolver) resolve(ident *ast.Ident, collectUnresolved bool) {
        if ident.Obj != nil {
                panic(r.sprintf("%v: identifier %s already declared or resolved", ident.Pos(), ident.Name))
index 89e8016409c826bd6acbbff6b0d1d0af2a39f013..f4fbde8ae6c60607279d2a67f12d63634fae87e7 100644 (file)
@@ -44,7 +44,6 @@ import (
 // space taken up by them is not considered to reduce the number of
 // linebreaks. At the moment there is no easy way to know about
 // future (not yet interspersed) comments in this function.
-//
 func (p *printer) linebreak(line, min int, ws whiteSpace, newSection bool) (nbreaks int) {
        n := nlimit(line - p.pos.Line)
        if n < min {
@@ -745,7 +744,6 @@ func reduceDepth(depth int) int {
 //     3) If there are no level 4 operators or no level 5 operators, then the
 //        cutoff is 6 (always use spaces) in Normal mode
 //        and 4 (never use spaces) in Compact mode.
-//
 func (p *printer) binaryExpr(x *ast.BinaryExpr, prec1, cutoff, depth int) {
        prec := x.Op.Precedence()
        if prec < prec1 {
@@ -1259,7 +1257,6 @@ func (p *printer) controlClause(isForStmt bool, init ast.Stmt, expr ast.Expr, po
 // indentList reports whether an expression list would look better if it
 // were indented wholesale (starting with the very first element, rather
 // than starting at the first line break).
-//
 func (p *printer) indentList(list []ast.Expr) bool {
        // Heuristic: indentList reports whether there are more than one multi-
        // line element in the list, or if there is any element that is not
@@ -1503,7 +1500,6 @@ func (p *printer) stmt(stmt ast.Stmt, nextIsRBrace bool) {
 //     -  V          -  V          true      column must be kept
 //     -  -          -  -          false
 //     -  V          V  -          false     V is moved into T column
-//
 func keepTypeColumn(specs []ast.Spec) []bool {
        m := make([]bool, len(specs))
 
@@ -1614,7 +1610,6 @@ func sanitizeImportPath(lit *ast.BasicLit) *ast.BasicLit {
 // The parameter n is the number of specs in the group. If doIndent is set,
 // multi-line identifier lists in the spec are indented when the first
 // linebreak is encountered.
-//
 func (p *printer) spec(spec ast.Spec, n int, doIndent bool) {
        switch s := spec.(type) {
        case *ast.ImportSpec:
@@ -1710,7 +1705,6 @@ func (p *printer) genDecl(d *ast.GenDecl) {
 // The result is <= maxSize if the node fits on one line with at
 // most maxSize chars and the formatted output doesn't contain
 // any control chars. Otherwise, the result is > maxSize.
-//
 func (p *printer) nodeSize(n ast.Node, maxSize int) (size int) {
        // nodeSize invokes the printer, which may invoke nodeSize
        // recursively. For deep composite literal nests, this can
@@ -1784,7 +1778,6 @@ func (p *printer) bodySize(b *ast.BlockStmt, maxSize int) int {
 // the block is printed on the current line, without line breaks, spaced from the header
 // by sep. Otherwise the block's opening "{" is printed on the current line, followed by
 // lines for the block's statements and its closing "}".
-//
 func (p *printer) funcBody(headerSize int, sep whiteSpace, b *ast.BlockStmt) {
        if b == nil {
                return
index e4679b0021d91e8edce40b0731c05257b43a8425..5014f59ab5c5d585b7fa3376b855d89d5b06f899 100644 (file)
@@ -151,14 +151,12 @@ func (p *printer) nextComment() {
 // commentBefore reports whether the current comment group occurs
 // before the next position in the source code and printing it does
 // not introduce implicit semicolons.
-//
 func (p *printer) commentBefore(next token.Position) bool {
        return p.commentOffset < next.Offset && (!p.impliedSemi || !p.commentNewline)
 }
 
 // commentSizeBefore returns the estimated size of the
 // comments on the same line before the next position.
-//
 func (p *printer) commentSizeBefore(next token.Position) int {
        // save/restore current p.commentInfo (p.nextComment() modifies it)
        defer func(info commentInfo) {
@@ -179,7 +177,6 @@ func (p *printer) commentSizeBefore(next token.Position) int {
 // token in *linePtr. It is used to compute an accurate line number for a
 // formatted construct, independent of pending (not yet emitted) whitespace
 // or comments.
-//
 func (p *printer) recordLine(linePtr *int) {
        p.linePtr = linePtr
 }
@@ -188,7 +185,6 @@ func (p *printer) recordLine(linePtr *int) {
 // output line and the line argument, ignoring any pending (not yet
 // emitted) whitespace or comments. It is used to compute an accurate
 // size (in number of lines) for a formatted construct.
-//
 func (p *printer) linesFrom(line int) int {
        return p.out.Line - line
 }
@@ -282,7 +278,6 @@ func (p *printer) writeByte(ch byte, n int) {
 // needed (i.e., when we don't know that s contains no tabs or line breaks)
 // avoids processing extra escape characters and reduces run time of the
 // printer benchmark by up to 10%.
-//
 func (p *printer) writeString(pos token.Position, s string, isLit bool) {
        if p.out.Column == 1 {
                if p.Config.Mode&SourcePos != 0 {
@@ -352,7 +347,6 @@ func (p *printer) writeString(pos token.Position, s string, isLit bool) {
 // pos is the comment position, next the position of the item
 // after all pending comments, prev is the previous comment in
 // a group of comments (or nil), and tok is the next token.
-//
 func (p *printer) writeCommentPrefix(pos, next token.Position, prev *ast.Comment, tok token.Token) {
        if len(p.output) == 0 {
                // the comment is the first item to be printed - don't write any whitespace
@@ -478,7 +472,6 @@ func (p *printer) writeCommentPrefix(pos, next token.Position, prev *ast.Comment
 
 // Returns true if s contains only white space
 // (only tabs and blanks can appear in the printer's context).
-//
 func isBlank(s string) bool {
        for i := 0; i < len(s); i++ {
                if s[i] > ' ' {
@@ -507,7 +500,6 @@ func trimRight(s string) string {
 // The prefix is computed using heuristics such that is likely that the comment
 // contents are nicely laid out after re-printing each line using the printer's
 // current indentation.
-//
 func stripCommonPrefix(lines []string) {
        if len(lines) <= 1 {
                return // at most one line - nothing to do
@@ -695,7 +687,6 @@ func (p *printer) writeComment(comment *ast.Comment) {
 // pending whitespace. The writeCommentSuffix result indicates if a
 // newline was written or if a formfeed was dropped from the whitespace
 // buffer.
-//
 func (p *printer) writeCommentSuffix(needsLinebreak bool) (wroteNewline, droppedFF bool) {
        for i, ch := range p.wsbuf {
                switch ch {
@@ -744,7 +735,6 @@ func (p *printer) containsLinebreak() bool {
 // that needs to be written before the next token). A heuristic is used to mix
 // the comments and whitespace. The intersperseComments result indicates if a
 // newline was written or if a formfeed was dropped from the whitespace buffer.
-//
 func (p *printer) intersperseComments(next token.Position, tok token.Token) (wroteNewline, droppedFF bool) {
        var last *ast.Comment
        for p.commentBefore(next) {
@@ -877,7 +867,6 @@ func mayCombine(prev token.Token, next byte) (b bool) {
 // taking into account the amount and structure of any pending white-
 // space for best comment placement. Then, any leftover whitespace is
 // printed, followed by the actual token.
-//
 func (p *printer) print(args ...any) {
        for _, arg := range args {
                // information about the current arg
@@ -1020,7 +1009,6 @@ func (p *printer) print(args ...any) {
 // before the position of the next token tok. The flush result indicates
 // if a newline was written or if a formfeed was dropped from the whitespace
 // buffer.
-//
 func (p *printer) flush(next token.Position, tok token.Token) (wroteNewline, droppedFF bool) {
        if p.commentBefore(next) {
                // if there are comments before the next item, intersperse them
@@ -1175,7 +1163,6 @@ unsupported:
 // and vtab characters into newlines and htabs (in case no tabwriter
 // is used). Text bracketed by tabwriter.Escape characters is passed
 // through unchanged.
-//
 type trimmer struct {
        output io.Writer
        state  int
@@ -1363,7 +1350,6 @@ func (cfg *Config) fprint(output io.Writer, fset *token.FileSet, node any, nodeS
 
 // A CommentedNode bundles an AST node and corresponding comments.
 // It may be provided as argument to any of the Fprint functions.
-//
 type CommentedNode struct {
        Node     any // *ast.File, or ast.Expr, ast.Decl, ast.Spec, or ast.Stmt
        Comments []*ast.CommentGroup
@@ -1373,7 +1359,6 @@ type CommentedNode struct {
 // Position information is interpreted relative to the file set fset.
 // The node type must be *ast.File, *CommentedNode, []ast.Decl, []ast.Stmt,
 // or assignment-compatible to ast.Expr, ast.Decl, ast.Spec, or ast.Stmt.
-//
 func (cfg *Config) Fprint(output io.Writer, fset *token.FileSet, node any) error {
        return cfg.fprint(output, fset, node, make(map[ast.Node]int))
 }
@@ -1382,7 +1367,6 @@ func (cfg *Config) Fprint(output io.Writer, fset *token.FileSet, node any) error
 // It calls Config.Fprint with default settings.
 // Note that gofmt uses tabs for indentation but spaces for alignment;
 // use format.Node (package go/format) for output that matches gofmt.
-//
 func Fprint(output io.Writer, fset *token.FileSet, node any) error {
        return (&Config{Tabwidth: 8}).Fprint(output, fset, node)
 }
index 2071aa8aa6e86219542c90924b1fb44f271f58c8..ad2d86052a460efcd4dca0d6742bcbedd17d6815 100644 (file)
@@ -212,7 +212,6 @@ func TestFiles(t *testing.T) {
 // TestLineComments, using a simple test case, checks that consecutive line
 // comments are properly terminated with a newline even if the AST position
 // information is incorrect.
-//
 func TestLineComments(t *testing.T) {
        const src = `// comment 1
        // comment 2
index 615aceebd21485da4baaabc6df8e7a611c925f5a..bb06c8dd424b0b62ae67c55c85cec974fe7e5d67 100644 (file)
@@ -19,7 +19,6 @@ import (
 // The mode parameter to the Parse* functions is a set of flags (or 0).
 // They control the amount of source code parsed and other optional
 // parser functionality.
-//
 const (
        PackageClauseOnly uint = 1 << iota // parsing stops after package clause
        ImportsOnly                        // parsing stops after import declarations
@@ -271,7 +270,6 @@ func (p *parser) consumeComment() (comment *ast.Comment, endline int) {
 // comments list, and return it together with the line at which
 // the last comment in the group ends. An empty line or non-comment
 // token terminates a comment group.
-//
 func (p *parser) consumeCommentGroup() (comments *ast.CommentGroup, endline int) {
        var list []*ast.Comment
        endline = p.file.Line(p.pos)
@@ -302,7 +300,6 @@ func (p *parser) consumeCommentGroup() (comments *ast.CommentGroup, endline int)
 //
 // Lead and line comments may be considered documentation that is
 // stored in the AST.
-//
 func (p *parser) next() {
        p.leadComment = nil
        p.lineComment = nil
@@ -947,7 +944,6 @@ func (p *parser) parseFuncTypeOrLit() ast.Expr {
 // parseOperand may return an expression or a raw type (incl. array
 // types of the form [...]T. Callers must verify the result.
 // If lhs is set and the result is an identifier, it is not resolved.
-//
 func (p *parser) parseOperand(lhs bool) ast.Expr {
        if p.trace {
                defer un(trace(p, "Operand"))
@@ -1214,7 +1210,6 @@ func unparen(x ast.Expr) ast.Expr {
 
 // checkExprOrType checks that x is an expression or a type
 // (and not a raw type such as [...]T).
-//
 func (p *parser) checkExprOrType(x ast.Expr) ast.Expr {
        switch t := unparen(x).(type) {
        case *ast.ParenExpr:
index 3114f4b645d91da154031f73caa147a8153aee51..3e9c365cca28800e4daadc5cbdb69d160b68647a 100644 (file)
@@ -15,7 +15,6 @@ import (
 // The position Pos, if valid, points to the beginning of
 // the offending token, and the error condition is described
 // by Msg.
-//
 type Error struct {
        Pos token.Position
        Msg string
@@ -33,7 +32,6 @@ func (e Error) Error() string {
 
 // ErrorList is a list of *Errors.
 // The zero value for an ErrorList is an empty ErrorList ready to use.
-//
 type ErrorList []*Error
 
 // Add adds an Error with given position and error message to an ErrorList.
@@ -69,7 +67,6 @@ func (p ErrorList) Less(i, j int) bool {
 // Sort sorts an ErrorList. *Error entries are sorted by position,
 // other errors are sorted by error message, and before any *Error
 // entry.
-//
 func (p ErrorList) Sort() {
        sort.Sort(p)
 }
@@ -112,7 +109,6 @@ func (p ErrorList) Err() error {
 // PrintError is a utility function that prints a list of errors to w,
 // one error per line, if the err parameter is an ErrorList. Otherwise
 // it prints the err string.
-//
 func PrintError(w io.Writer, err error) {
        if list, ok := err.(ErrorList); ok {
                for _, e := range list {
index 23d8db9d1ccdf76a1f45fff6bd586d74bf78bc68..b53de7a42703f2439abaeab0f4c3e52cdcdba9b5 100644 (file)
@@ -22,13 +22,11 @@ import (
 // encountered and a handler was installed, the handler is called with a
 // position and an error message. The position points to the beginning of
 // the offending token.
-//
 type ErrorHandler func(pos token.Position, msg string)
 
 // A Scanner holds the scanner's internal state while processing
 // a given text. It can be allocated as part of another data
 // structure but must be initialized via Init before use.
-//
 type Scanner struct {
        // immutable state
        file *token.File  // source file handle
@@ -101,7 +99,6 @@ func (s *Scanner) peek() byte {
 
 // A mode value is a set of flags (or 0).
 // They control scanner behavior.
-//
 type Mode uint
 
 const (
@@ -123,7 +120,6 @@ const (
 //
 // Note that Init may call err if there is an error in the first character
 // of the file.
-//
 func (s *Scanner) Init(file *token.File, src []byte, err ErrorHandler, mode Mode) {
        // Explicitly initialize all fields since a scanner may be reused.
        if file.Size() != len(src) {
@@ -825,7 +821,6 @@ func (s *Scanner) switch4(tok0, tok1 token.Token, ch2 rune, tok2, tok3 token.Tok
 // Scan adds line information to the file added to the file
 // set with Init. Token positions are relative to that file
 // and thus relative to the file set.
-//
 func (s *Scanner) Scan() (pos token.Pos, tok token.Token, lit string) {
 scanAgain:
        s.skipWhitespace()
index ce4af039237ce6f3cb12005e8f34fe8430ad04a5..00f24535bfd0ede40b50f8d0707b3c8f0a19db6a 100644 (file)
@@ -16,7 +16,6 @@ import (
 // Position describes an arbitrary source position
 // including the file, line, and column location.
 // A Position is valid if the line number is > 0.
-//
 type Position struct {
        Filename string // filename, if any
        Offset   int    // offset, starting at 0
@@ -35,7 +34,6 @@ func (pos *Position) IsValid() bool { return pos.Line > 0 }
 //     line                valid position without file name and no column (column == 0)
 //     file                invalid position with file name
 //     -                   invalid position without file name
-//
 func (pos Position) String() string {
        s := pos.Filename
        if pos.IsValid() {
@@ -75,14 +73,12 @@ func (pos Position) String() string {
 // equivalent to comparing the respective source file offsets. If p and q
 // are in different files, p < q is true if the file implied by p was added
 // to the respective file set before the file implied by q.
-//
 type Pos int
 
 // The zero value for Pos is NoPos; there is no file and line information
 // associated with it, and NoPos.IsValid() is false. NoPos is always
 // smaller than any other Pos value. The corresponding Position value
 // for NoPos is the zero value for Position.
-//
 const NoPos Pos = 0
 
 // IsValid reports whether the position is valid.
@@ -95,7 +91,6 @@ func (p Pos) IsValid() bool {
 
 // A File is a handle for a file belonging to a FileSet.
 // A File has a name, size, and line offset table.
-//
 type File struct {
        set  *FileSet
        name string // file name as provided to AddFile
@@ -134,7 +129,6 @@ func (f *File) LineCount() int {
 // AddLine adds the line offset for a new line.
 // The line offset must be larger than the offset for the previous line
 // and smaller than the file size; otherwise the line offset is ignored.
-//
 func (f *File) AddLine(offset int) {
        f.mutex.Lock()
        if i := len(f.lines); (i == 0 || f.lines[i-1] < offset) && offset < f.size {
@@ -147,7 +141,6 @@ func (f *File) AddLine(offset int) {
 // the newline character at the end of the line with a space (to not change the
 // remaining offsets). To obtain the line number, consult e.g. Position.Line.
 // MergeLine will panic if given an invalid line number.
-//
 func (f *File) MergeLine(line int) {
        if line < 1 {
                panic(fmt.Sprintf("invalid line number %d (should be >= 1)", line))
@@ -174,7 +167,6 @@ func (f *File) MergeLine(line int) {
 // and smaller than the file size; otherwise SetLines fails and returns
 // false.
 // Callers must not mutate the provided slice after SetLines returns.
-//
 func (f *File) SetLines(lines []int) bool {
        // verify validity of lines table
        size := f.size
@@ -239,7 +231,6 @@ type lineInfo struct {
 
 // AddLineInfo is like AddLineColumnInfo with a column = 1 argument.
 // It is here for backward-compatibility for code prior to Go 1.11.
-//
 func (f *File) AddLineInfo(offset int, filename string, line int) {
        f.AddLineColumnInfo(offset, filename, line, 1)
 }
@@ -252,7 +243,6 @@ func (f *File) AddLineInfo(offset int, filename string, line int) {
 //
 // AddLineColumnInfo is typically used to register alternative position
 // information for line directives such as //line filename:line:column.
-//
 func (f *File) AddLineColumnInfo(offset int, filename string, line, column int) {
        f.mutex.Lock()
        if i := len(f.infos); i == 0 || f.infos[i-1].Offset < offset && offset < f.size {
@@ -264,7 +254,6 @@ func (f *File) AddLineColumnInfo(offset int, filename string, line, column int)
 // Pos returns the Pos value for the given file offset;
 // the offset must be <= f.Size().
 // f.Pos(f.Offset(p)) == p.
-//
 func (f *File) Pos(offset int) Pos {
        if offset > f.size {
                panic(fmt.Sprintf("invalid file offset %d (should be <= %d)", offset, f.size))
@@ -275,7 +264,6 @@ func (f *File) Pos(offset int) Pos {
 // Offset returns the offset for the given file position p;
 // p must be a valid Pos value in that file.
 // f.Offset(f.Pos(offset)) == offset.
-//
 func (f *File) Offset(p Pos) int {
        if int(p) < f.base || int(p) > f.base+f.size {
                panic(fmt.Sprintf("invalid Pos value %d (should be in [%d, %d])", p, f.base, f.base+f.size))
@@ -285,7 +273,6 @@ func (f *File) Offset(p Pos) int {
 
 // Line returns the line number for the given file position p;
 // p must be a Pos value in that file or NoPos.
-//
 func (f *File) Line(p Pos) int {
        return f.Position(p).Line
 }
@@ -297,7 +284,6 @@ func searchLineInfos(a []lineInfo, x int) int {
 // unpack returns the filename and line and column number for a file offset.
 // If adjusted is set, unpack will return the filename and line information
 // possibly adjusted by //line comments; otherwise those comments are ignored.
-//
 func (f *File) unpack(offset int, adjusted bool) (filename string, line, column int) {
        f.mutex.Lock()
        defer f.mutex.Unlock()
@@ -342,7 +328,6 @@ func (f *File) position(p Pos, adjusted bool) (pos Position) {
 // If adjusted is set, the position may be adjusted by position-altering
 // //line comments; otherwise those comments are ignored.
 // p must be a Pos value in f or NoPos.
-//
 func (f *File) PositionFor(p Pos, adjusted bool) (pos Position) {
        if p != NoPos {
                if int(p) < f.base || int(p) > f.base+f.size {
@@ -355,7 +340,6 @@ func (f *File) PositionFor(p Pos, adjusted bool) (pos Position) {
 
 // Position returns the Position value for the given file position p.
 // Calling f.Position(p) is equivalent to calling f.PositionFor(p, true).
-//
 func (f *File) Position(p Pos) (pos Position) {
        return f.PositionFor(p, true)
 }
@@ -382,7 +366,6 @@ func (f *File) Position(p Pos) (pos Position) {
 // recently added file, plus one. Unless there is a need to extend an
 // interval later, using the FileSet.Base should be used as argument
 // for FileSet.AddFile.
-//
 type FileSet struct {
        mutex sync.RWMutex // protects the file set
        base  int          // base offset for the next file
@@ -399,7 +382,6 @@ func NewFileSet() *FileSet {
 
 // Base returns the minimum base offset that must be provided to
 // AddFile when adding the next file.
-//
 func (s *FileSet) Base() int {
        s.mutex.RLock()
        b := s.base
@@ -423,7 +405,6 @@ func (s *FileSet) Base() int {
 // with offs in the range [0, size] and thus p in the range [base, base+size].
 // For convenience, File.Pos may be used to create file-specific position
 // values from a file offset.
-//
 func (s *FileSet) AddFile(filename string, base, size int) *File {
        s.mutex.Lock()
        defer s.mutex.Unlock()
@@ -451,7 +432,6 @@ func (s *FileSet) AddFile(filename string, base, size int) *File {
 
 // Iterate calls f for the files in the file set in the order they were added
 // until f returns false.
-//
 func (s *FileSet) Iterate(f func(*File) bool) {
        for i := 0; ; i++ {
                var file *File
@@ -496,7 +476,6 @@ func (s *FileSet) file(p Pos) *File {
 // File returns the file that contains the position p.
 // If no such file is found (for instance for p == NoPos),
 // the result is nil.
-//
 func (s *FileSet) File(p Pos) (f *File) {
        if p != NoPos {
                f = s.file(p)
@@ -508,7 +487,6 @@ func (s *FileSet) File(p Pos) (f *File) {
 // If adjusted is set, the position may be adjusted by position-altering
 // //line comments; otherwise those comments are ignored.
 // p must be a Pos value in s or NoPos.
-//
 func (s *FileSet) PositionFor(p Pos, adjusted bool) (pos Position) {
        if p != NoPos {
                if f := s.file(p); f != nil {
@@ -520,7 +498,6 @@ func (s *FileSet) PositionFor(p Pos, adjusted bool) (pos Position) {
 
 // Position converts a Pos p in the fileset into a Position value.
 // Calling s.Position(p) is equivalent to calling s.PositionFor(p, true).
-//
 func (s *FileSet) Position(p Pos) (pos Position) {
        return s.PositionFor(p, true)
 }
index 17047d87138d61bd5b55249e299d69459182b44b..b6918832617ef5e28885c471fcb4570a8f87e45b 100644 (file)
@@ -239,7 +239,6 @@ var tokens = [...]string{
 // token character sequence (e.g., for the token ADD, the string is
 // "+"). For all other tokens the string corresponds to the token
 // constant name (e.g. for the token IDENT, the string is "IDENT").
-//
 func (tok Token) String() string {
        s := ""
        if 0 <= tok && tok < Token(len(tokens)) {
@@ -256,7 +255,6 @@ func (tok Token) String() string {
 // starting with precedence 1 up to unary operators. The highest
 // precedence serves as "catch-all" precedence for selector,
 // indexing, and other operator and delimiter tokens.
-//
 const (
        LowestPrec  = 0 // non-operators
        UnaryPrec   = 6
@@ -266,7 +264,6 @@ const (
 // Precedence returns the operator precedence of the binary
 // operator op. If op is not a binary operator, the result
 // is LowestPrecedence.
-//
 func (op Token) Precedence() int {
        switch op {
        case LOR:
@@ -293,7 +290,6 @@ func init() {
 }
 
 // Lookup maps an identifier to its keyword token or IDENT (if not a keyword).
-//
 func Lookup(ident string) Token {
        if tok, is_keyword := keywords[ident]; is_keyword {
                return tok
@@ -305,30 +301,25 @@ func Lookup(ident string) Token {
 
 // IsLiteral returns true for tokens corresponding to identifiers
 // and basic type literals; it returns false otherwise.
-//
 func (tok Token) IsLiteral() bool { return literal_beg < tok && tok < literal_end }
 
 // IsOperator returns true for tokens corresponding to operators and
 // delimiters; it returns false otherwise.
-//
 func (tok Token) IsOperator() bool {
        return (operator_beg < tok && tok < operator_end) || tok == TILDE
 }
 
 // IsKeyword returns true for tokens corresponding to keywords;
 // it returns false otherwise.
-//
 func (tok Token) IsKeyword() bool { return keyword_beg < tok && tok < keyword_end }
 
 // IsExported reports whether name starts with an upper-case letter.
-//
 func IsExported(name string) bool {
        ch, _ := utf8.DecodeRuneInString(name)
        return unicode.IsUpper(ch)
 }
 
 // IsKeyword reports whether name is a Go keyword, such as "func" or "return".
-//
 func IsKeyword(name string) bool {
        // TODO: opt: use a perfect hash function instead of a global map.
        _, ok := keywords[name]
@@ -338,7 +329,6 @@ func IsKeyword(name string) bool {
 // IsIdentifier reports whether name is a Go identifier, that is, a non-empty
 // string made up of letters, digits, and underscores, where the first character
 // is not a digit. Keywords are not identifiers.
-//
 func IsIdentifier(name string) bool {
        if name == "" || IsKeyword(name) {
                return false
index 2cbabb0a53056684d8b3829d9773c39d9e002287..04342bfac57e476b961db11513ba378b62f06601 100644 (file)
@@ -280,7 +280,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 ast.Expr) Type {
        if t, ok := info.Types[e]; ok {
                return t.Type
@@ -300,7 +299,6 @@ func (info *Info) TypeOf(e ast.Expr) Type {
 // it defines, not the type (*TypeName) it uses.
 //
 // Precondition: the Uses and Defs maps are populated.
-//
 func (info *Info) ObjectOf(id *ast.Ident) Object {
        if obj := info.Defs[id]; obj != nil {
                return obj
index c81e73c828840f76d97062330176497af9d1ec47..414c2c3ea065de91439aef95bf2b7411329e5e1d 100644 (file)
@@ -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 *ast.CallExpr, id builtinId) (_ bool) {
        // append is the only built-in that permits the use of ... for the last argument
        bin := predeclaredFuncs[id]
index 592ced41ec4b83af79ec4aca6f04f097d15d98e0..5c42d124eac30a8f191d197c05ae2a7f2c54744b 100644 (file)
@@ -55,7 +55,6 @@ var posMsgRx = regexp.MustCompile(`^(.*:[0-9]+:[0-9]+): *(?s)(.*)`)
 // splitError splits an error's error message into a position string
 // and the actual error message. If there's no position information,
 // pos is the empty string, and msg is the entire error message.
-//
 func splitError(err error) (pos, msg string) {
        msg = err.Error()
        if m := posMsgRx.FindStringSubmatch(msg); len(m) == 3 {
@@ -92,7 +91,6 @@ func parseFiles(t *testing.T, filenames []string, srcs [][]byte, mode parser.Mod
 // Space around "rx" or rx is ignored. Use the form `ERROR HERE "rx"`
 // for error messages that are located immediately after rather than
 // at a token's position.
-//
 var errRx = regexp.MustCompile(`^ *ERROR *(HERE)? *"?([^"]*)"?`)
 
 // errMap collects the regular expressions of ERROR comments found
index 5700cbf79c72ad4dfea4556d0fe9058a92421960..084f746fe671a82a1c8a43d2b54e10d5599e99ee 100644 (file)
@@ -53,7 +53,6 @@ func Eval(fset *token.FileSet, pkg *Package, pos token.Pos, expr string) (_ Type
 // functions ignore the context in which an expression is used (e.g., an
 // assignment). Thus, top-level untyped constants will return an
 // untyped type rather then the respective context-specific type.
-//
 func CheckExpr(fset *token.FileSet, pkg *Package, pos token.Pos, expr ast.Expr, info *Info) (err error) {
        // determine scope
        var scope *Scope
index a3c9041bddfba60d105427c79119f0d01bbfd5e0..1def8cc84d91b719ddfb5c0fda9020d7a1b4e17d 100644 (file)
@@ -1194,7 +1194,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 ast.Expr, hint Type, allowGeneric bool) exprKind {
        if trace {
                check.trace(e.Pos(), "-- expr %s", e)
@@ -1242,7 +1241,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 ast.Expr, hint Type) exprKind {
        // make sure x has a valid state in case of bailout
        // (was issue 5770)
@@ -1707,7 +1705,6 @@ func (check *Checker) typeAssertion(e ast.Expr, x *operand, T Type, typeSwitch b
 // 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 ast.Expr) {
        check.rawExpr(x, e, nil, false)
        check.exclude(x, 1<<novalue|1<<builtin|1<<typexpr)
@@ -1723,7 +1720,6 @@ func (check *Checker) multiExpr(x *operand, e ast.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 ast.Expr, hint Type) {
        assert(hint != nil)
        check.rawExpr(x, e, hint, false)
@@ -1735,7 +1731,6 @@ func (check *Checker) exprWithHint(x *operand, e ast.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 ast.Expr, allowGeneric bool) {
        check.rawExpr(x, e, nil, allowGeneric)
        check.exclude(x, 1<<novalue)
index 670c95d6219dce093b3dd55bfe5d10860224ac09..f963d31196cad15c76d07bf978aba73da122e9ba 100644 (file)
@@ -411,7 +411,6 @@ func (check *Checker) isValidIndex(x *operand, code errorCode, what string, allo
 // against the literal's element type (typ), and the element indices against
 // the literal length if known (length >= 0). It returns the length of the
 // literal (maximum index value + 1).
-//
 func (check *Checker) indexedElts(elts []ast.Expr, typ Type, length int64) int64 {
        visited := make(map[int64]bool, len(elts))
        var index, max int64
index 77fc17f5c357d30f032c960cce73858698c8bff4..e38f56c95652972c423978f29312a7777c936b80 100644 (file)
@@ -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")
@@ -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.
index 8975fc93dc073b57d637a9110f7d59634e0d8186..89dcd83c2d32f09621109bdd43a8a1e65e9d489b 100644 (file)
@@ -14,7 +14,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() token.Pos // position of object identifier in declaration
index 4d7f1e3b63f274b6ce30aefa010f1037f104e6dd..f9f109aa69a82c377d0b58668c595371f1e2e19e 100644 (file)
@@ -49,7 +49,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 ast.Expr
@@ -60,7 +59,6 @@ type operand struct {
 
 // Pos returns the position of the expression corresponding to x.
 // If x is invalid the position is token.NoPos.
-//
 func (x *operand) Pos() token.Pos {
        // x.expr may not be set if x is invalid
        if x.expr == nil {
@@ -102,7 +100,6 @@ func (x *operand) Pos() token.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 == value && x.typ == Typ[UntypedNil] {
index 6ec69d21dba478e59d43adcdfaa20e61e20e0fb8..4e06ab16b4e7d188f44c0f0fc8d54c5662ce1a1e 100644 (file)
@@ -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
@@ -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 {
index dd4b78969f6844d8674f10201149331ac4c13ecb..fd18fc5796947f3c035564c105eac6189615111f 100644 (file)
@@ -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
index 80210a2f34cd71981b47feb59f0ce46ed40f7efe..0325d4a77f5c16385a6e982023375761abaa8718 100644 (file)
@@ -26,7 +26,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
index 6b6782100084f66aa1ea9add9c35e2910b05d17c..13b6ce6d0df888f38c3df9fd9339993828721da6 100644 (file)
@@ -10,7 +10,6 @@ package types
 //   𝓤:  &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
index bae9dc816c7fe233e88c14ef5443f6c66cb10737..b704372dcf6d8835435be4ca5496a87dde0bba96 100644 (file)
@@ -18,7 +18,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 *ast.Ident, def *Named, wantType bool) {
        x.mode = invalid
        x.expr = e
@@ -177,7 +176,6 @@ func (check *Checker) validVarType(e ast.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 ast.Expr, def *Named) Type {
        typ := check.typInternal(e, def)
        assert(isTyped(typ))
@@ -214,7 +212,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 ast.Expr, def *Named) (T Type) {
        if trace {
                check.trace(e0.Pos(), "-- type %s", e0)
index f58128f480e2194014856b8b528f55f67948c786..8ac48e506ef2105a4e6045622da1bfb0099f790e 100644 (file)
@@ -246,7 +246,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()
index 952f52979d5b1543b94769c28dfe0e68418f0f95..a99f69231cbe6ddcb88418d933a16d28da5259d3 100644 (file)
@@ -72,7 +72,6 @@ func (t *Template) Templates() []*Template {
 //             The operation returns the zero value for the map type's element.
 //     "missingkey=error"
 //             Execution stops immediately with an error.
-//
 func (t *Template) Option(opt ...string) *Template {
        t.text.Option(opt...)
        return t
index 9c169e7aca84e44951e41f3cd42402bd33f711d4..cdc6e81a800cb9863d9607f1048304dc7427983d 100644 (file)
@@ -230,7 +230,6 @@ func (x *Index) Write(w io.Writer) error {
 
 // Bytes returns the data over which the index was created.
 // It must not be modified.
-//
 func (x *Index) Bytes() []byte {
        return x.data
 }
@@ -255,7 +254,6 @@ func (x *Index) lookupAll(s []byte) ints {
 // The result is nil if s is empty, s is not found, or n == 0.
 // Lookup time is O(log(N)*len(s) + len(result)) where N is the
 // size of the indexed data.
-//
 func (x *Index) Lookup(s []byte, n int) (result []int) {
        if len(s) > 0 && n != 0 {
                matches := x.lookupAll(s)
@@ -286,7 +284,6 @@ func (x *Index) Lookup(s []byte, n int) (result []int) {
 // in successive order. Otherwise, at most n matches are returned and
 // they may not be successive. The result is nil if there are no matches,
 // or if n == 0.
-//
 func (x *Index) FindAllIndex(r *regexp.Regexp, n int) (result [][]int) {
        // a non-empty literal prefix is used to determine possible
        // match start indices with Lookup
index 34c1f477f0e31438209c5c96b4a1b20d2cf58511..09e987d0e6f51bd1b9cca61b13ef8502e68771d3 100644 (file)
@@ -48,7 +48,6 @@ func (o *SortedMap) Swap(i, j int) {
 //    Otherwise identical arrays compare by length.
 //  - interface values compare first by reflect.Type describing the concrete type
 //    and then by concrete value as described in the previous rules.
-//
 func Sort(mapValue reflect.Value) *SortedMap {
        if mapValue.Type().Kind() != reflect.Map {
                return nil
index 52a51bbd377e5a91c80e9a415024efe6cfc283d6..37800794a2339d484b8dab59d18eef425e77456b 100644 (file)
@@ -58,7 +58,6 @@ var SkipDir = errors.New("skip this directory")
 //     to bypass the directory read entirely.
 //   - If a directory read fails, the function is called a second time
 //     for that directory to report the error.
-//
 type WalkDirFunc func(path string, d DirEntry, err error) error
 
 // walkDir recursively descends path, calling walkDirFn.
index a8c91a6e547c268371b1093ae0d57c5af2fa47a3..70c7b794a419703f61d5bb5ec83096025ede8ad4 100644 (file)
@@ -236,7 +236,6 @@ func (x *Float) Acc() Accuracy {
 //     -1 if x <   0
 //      0 if x is ±0
 //     +1 if x >   0
-//
 func (x *Float) Sign() int {
        if debugFloat {
                x.validate()
@@ -1672,7 +1671,6 @@ func (z *Float) Quo(x, y *Float) *Float {
 //   -1 if x <  y
 //    0 if x == y (incl. -0 == 0, -Inf == -Inf, and +Inf == +Inf)
 //   +1 if x >  y
-//
 func (x *Float) Cmp(y *Float) int {
        if debugFloat {
                x.validate()
@@ -1707,7 +1705,6 @@ func (x *Float) Cmp(y *Float) int {
 //      0 if x == 0 (signed or unsigned)
 //     +1 if 0 < x < +Inf
 //     +2 if x == +Inf
-//
 func (x *Float) ord() int {
        var m int
        switch x.form {
index 57b7df3936f936d12d5519fd49fde2885ebc9328..93f7195219f79b4190dd0faa40e95a2cf4cb36c7 100644 (file)
@@ -153,7 +153,6 @@ func (z *Float) scan(r io.ByteScanner, base int) (f *Float, b int, err error) {
 //     for p, q := uint64(0), uint64(1); p < q; p, q = q, q*5 {
 //             fmt.Println(q)
 //     }
-//
 var pow5tab = [...]uint64{
        1,
        5,
@@ -257,7 +256,6 @@ func (z *Float) pow5(n uint64) *Float {
 //
 // The returned *Float f is nil and the value of z is valid but not
 // defined if an error is reported.
-//
 func (z *Float) Parse(s string, base int) (f *Float, b int, err error) {
        // scan doesn't handle ±Inf
        if len(s) == 3 && (s == "Inf" || s == "inf") {
index 7647346486c4cb02c7fcbec6558c3b7b1841f755..700d00d031ad9f035b7ccc64ff37f50a206c3dd7 100644 (file)
@@ -34,7 +34,6 @@ var intOne = &Int{false, natOne}
 //     -1 if x <  0
 //      0 if x == 0
 //     +1 if x >  0
-//
 func (x *Int) Sign() int {
        if len(x.abs) == 0 {
                return 0
@@ -234,7 +233,6 @@ func (z *Int) Rem(x, y *Int) *Int {
 //
 // (See Daan Leijen, ``Division and Modulus for Computer Scientists''.)
 // See DivMod for Euclidean division and modulus (unlike Go).
-//
 func (z *Int) QuoRem(x, y, r *Int) (*Int, *Int) {
        z.abs, r.abs = z.abs.div(r.abs, x.abs, y.abs)
        z.neg, r.neg = len(z.abs) > 0 && x.neg != y.neg, len(r.abs) > 0 && x.neg // 0 has no sign
@@ -292,7 +290,6 @@ func (z *Int) Mod(x, y *Int) *Int {
 // Systems (TOPLAS), 14(2):127-144, New York, NY, USA, 4/1992.
 // ACM press.)
 // See QuoRem for T-division and modulus (like Go).
-//
 func (z *Int) DivMod(x, y, m *Int) (*Int, *Int) {
        y0 := y // save y
        if z == y || alias(z.abs, y.abs) {
@@ -316,7 +313,6 @@ func (z *Int) DivMod(x, y, m *Int) (*Int, *Int) {
 //   -1 if x <  y
 //    0 if x == y
 //   +1 if x >  y
-//
 func (x *Int) Cmp(y *Int) (r int) {
        // x cmp y == x cmp y
        // x cmp (-y) == x
@@ -343,7 +339,6 @@ func (x *Int) Cmp(y *Int) (r int) {
 //   -1 if |x| <  |y|
 //    0 if |x| == |y|
 //   +1 if |x| >  |y|
-//
 func (x *Int) CmpAbs(y *Int) int {
        return x.abs.cmp(y.abs)
 }
@@ -420,7 +415,6 @@ func (x *Int) IsUint64() bool {
 // Incorrect placement of underscores is reported as an error if there
 // are no other errors. If base != 0, underscores are not recognized
 // and act like any other character that is not a valid digit.
-//
 func (z *Int) SetString(s string, base int) (*Int, bool) {
        return z.setFromScanner(strings.NewReader(s), base)
 }
index 05672841056ddbe2aef939b31a10424e9fcc9500..2fe10ff0a24ca25de0cc40901e0257b2248e7eb5 100644 (file)
@@ -63,7 +63,6 @@ var _ fmt.Formatter = intOne // *Int must implement fmt.Formatter
 // specification of minimum digits precision, output field
 // width, space or zero padding, and '-' for left or right
 // justification.
-//
 func (x *Int) Format(s fmt.State, ch rune) {
        // determine base
        var base int
@@ -178,7 +177,6 @@ func (x *Int) Format(s fmt.State, ch rune) {
 // ``0b'' or ``0B'' selects base 2; a ``0'', ``0o'', or ``0O'' prefix selects
 // base 8, and a ``0x'' or ``0X'' prefix selects base 16. Otherwise the selected
 // base is 10.
-//
 func (z *Int) scan(r io.ByteScanner, base int) (*Int, int, error) {
        // determine sign
        neg, err := scanSign(r)
index 31e1ad8fcf073d3f1726f645bd6092616b22e058..ee0c63eb28105d7d127c91e51ba49857a33fb026 100644 (file)
@@ -31,7 +31,6 @@ import (
 // During arithmetic operations, denormalized values may occur but are
 // always normalized before returning the final result. The normalized
 // representation of 0 is the empty or nil slice (length = 0).
-//
 type nat []Word
 
 var (
index 42d1cccf6f8cf009eefc5b38ac4ed8eafb52428d..99488ac833a797d6e56690553e74d84fc6182a96 100644 (file)
@@ -105,7 +105,6 @@ var (
 // parsed. A digit count <= 0 indicates the presence of a period (if fracOk
 // is set, only), and -count is the number of fractional digits found.
 // In this case, the actual value of the scanned number is res * b**count.
-//
 func (z nat) scan(r io.ByteScanner, base int, fracOk bool) (res nat, b, count int, err error) {
        // reject invalid bases
        baseOk := base == 0 ||
@@ -366,7 +365,6 @@ func (x nat) itoa(neg bool, base int) []byte {
 // range 2..64 shows that values of 8 and 16 work well, with a 4x speedup at medium lengths and
 // ~30x for 20000 digits. Use nat_test.go's BenchmarkLeafSize tests to optimize leafSize for
 // specific hardware.
-//
 func (q nat) convertWords(s []byte, b Word, ndigits int, bb Word, table []divisor) {
        // split larger blocks recursively
        if table != nil {
index 731a979ff7a18896a0acfbfc2467e190063b2814..e77da67d1b9a167d5463b627ed60aabcd69ef07b 100644 (file)
@@ -392,7 +392,6 @@ func (z *Rat) Inv(x *Rat) *Rat {
 //     -1 if x <  0
 //      0 if x == 0
 //     +1 if x >  0
-//
 func (x *Rat) Sign() int {
        return x.a.Sign()
 }
@@ -482,7 +481,6 @@ func (z *Int) scaleDenom(x *Int, f nat) {
 //   -1 if x <  y
 //    0 if x == y
 //   +1 if x >  y
-//
 func (x *Rat) Cmp(y *Rat) int {
        var a, b Int
        a.scaleDenom(&x.a, y.b.abs)
index 5a8d946c0cccd20c2985e28c99994c120bb46924..9a07ba1be00a5a140a0f6e2956b822900512209a 100644 (file)
@@ -27,7 +27,6 @@ const (
 // callers can adjust the output using:
 //
 //  sample = ExpFloat64() / desiredRateParameter
-//
 func (r *Rand) ExpFloat64() float64 {
        for {
                j := r.Uint32()
index 2c5a7aa99b8917d894855aafc1870d4e1c6ee74b..48ecdd5adbdd7baa639c4030989a8d42061e0e8f 100644 (file)
@@ -34,7 +34,6 @@ func absInt32(i int32) uint32 {
 // adjust the output using:
 //
 //  sample = NormFloat64() * desiredStdDev + desiredMean
-//
 func (r *Rand) NormFloat64() float64 {
        for {
                j := int32(r.Uint32()) // Possibly negative
index 13f20ca5efb28271d13f242a566ceaf5ff36be60..dfbd1fa4e7c84e73574c1ac1b11b87546b410788 100644 (file)
@@ -366,7 +366,6 @@ func Read(p []byte) (n int, err error) { return globalRand.Read(p) }
 // adjust the output using:
 //
 //  sample = NormFloat64() * desiredStdDev + desiredMean
-//
 func NormFloat64() float64 { return globalRand.NormFloat64() }
 
 // ExpFloat64 returns an exponentially distributed float64 in the range
@@ -376,7 +375,6 @@ func NormFloat64() float64 { return globalRand.NormFloat64() }
 // callers can adjust the output using:
 //
 //  sample = ExpFloat64() / desiredRateParameter
-//
 func ExpFloat64() float64 { return globalRand.ExpFloat64() }
 
 type lockedSource struct {
index 465ee0b723586e85fdc350f07f3fea5369eb8c77..bc0ed1fc506083463ff9b5d9ff88a52d6a130d95 100644 (file)
@@ -54,7 +54,6 @@ import (
 // with the expectation that the Jar will insert those mutated cookies
 // with the updated values (assuming the origin matches).
 // If Jar is nil, the initial cookies are forwarded without change.
-//
 type Client struct {
        // Transport specifies the mechanism by which individual
        // HTTP requests are made.
index 6caee9ed931e871337a56687c380bd8dc700c415..d8f924296bc75901b9b389a6b15d836b4b42bdbd 100644 (file)
@@ -836,7 +836,6 @@ func FS(fsys fs.FS) FileSystem {
 // To use an fs.FS implementation, use http.FS to convert it:
 //
 //     http.Handle("/", http.FileServer(http.FS(fsys)))
-//
 func FileServer(root FileSystem) Handler {
        return &fileHandler{root}
 }
index e41b20a15ba46656d4656e7e0152996f72bee113..f2d538b04a8c3ce9737f3d7dc952648d4ca927b5 100644 (file)
@@ -1795,7 +1795,6 @@ var _ io.ReaderFrom = (*persistConnWriter)(nil)
 //     socks5://proxy.com|https|foo.com  socks5 to proxy, then https to foo.com
 //     https://proxy.com|https|foo.com   https to proxy, then CONNECT to foo.com
 //     https://proxy.com|http            https to proxy, http to anywhere after that
-//
 type connectMethod struct {
        _            incomparable
        proxyURL     *url.URL // nil for no proxy, else full proxy URL
index 157c59b17accfb2a48ca5ace16bf1d214ebe388c..ac47f007007a8faa54b7cf7d1f692c019b43b1ff 100644 (file)
@@ -88,7 +88,6 @@ func (r *Reader) readLineSlice() ([]byte, error) {
 // and the second will return "Line 2".
 //
 // Empty lines are never continued.
-//
 func (r *Reader) ReadContinuedLine() (string, error) {
        line, err := r.readContinuedLineSlice(noValidation)
        return string(line), err
@@ -230,7 +229,6 @@ func parseCodeLine(line string, expectCode int) (code int, continued bool, messa
 // If the response is multi-line, ReadCodeLine returns an error.
 //
 // An expectCode <= 0 disables the check of the status code.
-//
 func (r *Reader) ReadCodeLine(expectCode int) (code int, message string, err error) {
        code, continued, message, err := r.readCodeLine(expectCode)
        if err == nil && continued {
@@ -265,7 +263,6 @@ func (r *Reader) ReadCodeLine(expectCode int) (code int, message string, err err
 // the status is not in the range [310,319].
 //
 // An expectCode <= 0 disables the check of the status code.
-//
 func (r *Reader) ReadResponse(expectCode int) (code int, message string, err error) {
        code, continued, message, err := r.readCodeLine(expectCode)
        multi := continued
@@ -481,7 +478,6 @@ var colon = []byte(":")
 //             "My-Key": {"Value 1", "Value 2"},
 //             "Long-Key": {"Even Longer Value"},
 //     }
-//
 func (r *Reader) ReadMIMEHeader() (MIMEHeader, error) {
        // Avoid lots of small slice allocations later by allocating one
        // large one ahead of time which we'll cut up into smaller
index cc1a847e4e1e47aa86921cf388ae372acd6b384a..3487a7dfaf438ba2fc3e531160e6742f2eaa1d4e 100644 (file)
@@ -110,7 +110,6 @@ func Dial(network, addr string) (*Conn, error) {
 //             return nil, err
 //     }
 //     return c.ReadCodeLine(250)
-//
 func (c *Conn) Cmd(format string, args ...any) (id uint, err error) {
        id = c.Next()
        c.StartRequest(id)
index c77a26952a657f2c53bd9dafbf98deb4a7071f56..847a78133d3d4c157d776dd619a36e27c1b0ce23 100644 (file)
@@ -40,7 +40,6 @@ var ErrBadPattern = errors.New("syntax error in pattern")
 //
 // On Windows, escaping is disabled. Instead, '\\' is treated as
 // path separator.
-//
 func Match(pattern, name string) (matched bool, err error) {
 Pattern:
        for len(pattern) > 0 {
index 918624c60e80a31881a318ca8ce2928a366d6dfd..673bbc7ff6599626e40827e10444c8a2678e01ae 100644 (file)
@@ -34,7 +34,6 @@ var ErrBadPattern = errors.New("syntax error in pattern")
 // Match requires pattern to match all of name, not just a substring.
 // The only possible returned error is ErrBadPattern, when pattern
 // is malformed.
-//
 func Match(pattern, name string) (matched bool, err error) {
 Pattern:
        for len(pattern) > 0 {
index 06026232eea0fc443749b13b7e98f0ce0e4df72c..5a35d98b51f01c86993b4e46ce2a482f6ca9a122 100644 (file)
@@ -6291,7 +6291,6 @@ func TestAllocsInterfaceSmall(t *testing.T) {
 //     [false false false false]
 //     ...
 //     [true true true true]
-//
 type exhaustive struct {
        r    *rand.Rand
        pos  int
index d0b0935cb8cb2944fadb591c04ff3b42f0207c05..e4acdc318b0aca8459e1e03a70867135a5a9531e 100644 (file)
@@ -43,7 +43,6 @@ type makeFuncImpl struct {
 //
 // The Examples section of the documentation includes an illustration
 // of how to use MakeFunc to build a swap function for different types.
-//
 func MakeFunc(typ Type, fn func(args []Value) (results []Value)) Value {
        if typ.Kind() != Func {
                panic("reflect: call of MakeFunc with non-Func type")
index 89f0253570aa94b6c3a90ef835becf08bba4cd54..7a20b6bd23f54055100a7800e509fe23969a2ca1 100644 (file)
@@ -1830,7 +1830,6 @@ func (iter *MapIter) Reset(v Value) {
 //             v := iter.Value()
 //             ...
 //     }
-//
 func (v Value) MapRange() *MapIter {
        v.mustBe(Map)
        return &MapIter{m: v}
@@ -2785,7 +2784,6 @@ const (
 // Normally Chan's underlying value must be a channel and Send must be a zero Value.
 // If Chan is a zero Value, then the case is ignored, but Send must still be a zero Value.
 // When a receive operation is selected, the received Value is returned by Select.
-//
 type SelectCase struct {
        Dir  SelectDir // direction of case
        Chan Value     // channel to use (for send or receive)
index 5f8442668ca3c65dcc1f4be54bec12e693cb45b9..a6e833050bb46a936674b49af656facd4cb79ccc 100644 (file)
@@ -62,7 +62,6 @@ import (
 //
 // At time of writing, re2-exhaustive.txt is 59 MB but compresses to 385 kB,
 // so we store re2-exhaustive.txt.bz2 in the repository and decompress it on the fly.
-//
 func TestRE2Search(t *testing.T) {
        testRE2(t, "testdata/re2-search.txt")
 }
index 0f6587ab27f313b7d80b6a3237f497d527e9a0c5..fa45def9b7368121fa6998bc4e32c2ecdb750dc8 100644 (file)
@@ -449,7 +449,6 @@ func (p *parser) collapse(subs []*Regexp, op Op) *Regexp {
 //     A(B(C|D)|EF)|BC(X|Y)
 // which simplifies by character class introduction to
 //     A(B[CD]|EF)|BC[XY]
-//
 func (p *parser) factor(sub []*Regexp) []*Regexp {
        if len(sub) < 2 {
                return sub
index 16fec26aebe128d21999afc6fea661b53d5d3d6c..a16782ae94929d494794ecbc616029ed7b67f2b0 100644 (file)
@@ -683,7 +683,6 @@ func chanparkcommit(gp *g, chanLock unsafe.Pointer) bool {
 //     } else {
 //             ... bar
 //     }
-//
 func selectnbsend(c *hchan, elem unsafe.Pointer) (selected bool) {
        return chansend(c, elem, false, getcallerpc())
 }
@@ -704,7 +703,6 @@ func selectnbsend(c *hchan, elem unsafe.Pointer) (selected bool) {
 //     } else {
 //             ... bar
 //     }
-//
 func selectnbrecv(elem unsafe.Pointer, c *hchan) (selected, received bool) {
        return chanrecv(c, elem, false)
 }
index 1ebc62dea1919a61fa4ceb6256329d4503493bb2..f430a27719684559706586d10cbe9ef816dccb80 100644 (file)
@@ -9,5 +9,4 @@ package runtime
 //
 //     gc      Also known as cmd/compile.
 //     gccgo   The gccgo front end, part of the GCC compiler suite.
-//
 const Compiler = "gc"
index db36df1f375b377c54627df90786c0e8be91b0e1..6961c2ea9bc879a480ecc1d0b08f96ad763c82d4 100644 (file)
@@ -23,7 +23,6 @@ import (
 //
 //     func semawakeup(mp *m)
 //             Wake up mp, which is or will soon be sleeping on its semaphore.
-//
 const (
        locked uintptr = 1
 
index d75efce7a8b9ff22a536f0b4bf36f78cc7148cfa..e3cd6b9d2a265b5cb2a927364acac2280c4b31c5 100644 (file)
@@ -130,7 +130,6 @@ import (
 // The CPU profile is not available as a Profile. It has a special API,
 // the StartCPUProfile and StopCPUProfile functions, because it streams
 // output to a writer during profiling.
-//
 type Profile struct {
        name  string
        mu    sync.Mutex
@@ -276,7 +275,6 @@ func (p *Profile) Count() int {
 //
 // Passing skip=0 begins the stack trace at the call to Add inside rpc.NewClient.
 // Passing skip=1 begins the stack trace at the call to NewClient inside mypkg.Run.
-//
 func (p *Profile) Add(value any, skip int) {
        if p.name == "" {
                panic("pprof: use of uninitialized Profile")
index f40881aed5150db26d3556d135337f544d4469cb..3d907d56124fa3b93dda251a61bd786faa0ff889 100644 (file)
@@ -84,7 +84,6 @@ import (
 //     if uint32(overflow) > 0 {
 //             emit entry for uint32(overflow), time
 //     }
-//
 type profBuf struct {
        // accessed atomically
        r, w         profAtomic
index d05b5e22613098975b280c8651c885b3edf0623f..bf3dbc3d797dca4ee8de8b714b09bfee6bb9a7f6 100644 (file)
@@ -149,7 +149,6 @@ func WithRegion(ctx context.Context, regionType string, fn func()) {
 // Recommended usage is
 //
 //     defer trace.StartRegion(ctx, "myTracedRegion").End()
-//
 func StartRegion(ctx context.Context, regionType string) *Region {
        if !IsEnabled() {
                return noopRegion
index fcff0f9491bd38bd604af8907b90396722722301..601557a94b310022006245b4176d6339974fcd40 100644 (file)
@@ -55,7 +55,6 @@ package sort
 //             })
 //             fmt.Printf("Your number is %d.\n", answer)
 //     }
-//
 func Search(n int, f func(int) bool) int {
        // Define f(-1) == false and f(n) == true.
        // Invariant: f(i-1) == false, f(j) == true.
@@ -79,7 +78,6 @@ func Search(n int, f func(int) bool) int {
 // as specified by Search. The return value is the index to insert x if x is
 // not present (it could be len(a)).
 // The slice must be sorted in ascending order.
-//
 func SearchInts(a []int, x int) int {
        return Search(len(a), func(i int) bool { return a[i] >= x })
 }
@@ -88,7 +86,6 @@ func SearchInts(a []int, x int) int {
 // as specified by Search. The return value is the index to insert x if x is not
 // present (it could be len(a)).
 // The slice must be sorted in ascending order.
-//
 func SearchFloat64s(a []float64, x float64) int {
        return Search(len(a), func(i int) bool { return a[i] >= x })
 }
@@ -97,7 +94,6 @@ func SearchFloat64s(a []float64, x float64) int {
 // as specified by Search. The return value is the index to insert x if x is not
 // present (it could be len(a)).
 // The slice must be sorted in ascending order.
-//
 func SearchStrings(a []string, x string) int {
        return Search(len(a), func(i int) bool { return a[i] >= x })
 }
index ded68ebde0a2b38c237d090f28c9a1874853f269..f06897ee21e08ff9cb1363baf907840bf5b74833 100644 (file)
@@ -59,7 +59,6 @@ func TestSearch(t *testing.T) {
 
 // log2 computes the binary logarithm of x, rounded up to the next integer.
 // (log2(0) == 0, log2(1) == 0, log2(2) == 1, log2(3) == 2, etc.)
-//
 func log2(x int) int {
        n := 0
        for p := 1; p < x; p += p {
index 2c197afc033e7bfe19cd88e2d2616f3371d2926b..aed0eaba303bd1ceca2f3746d38447b563a9e568 100644 (file)
@@ -111,7 +111,6 @@ func (x Float64Slice) Len() int { return len(x) }
 // This implementation of Less places NaN values before any others, by using:
 //
 //     x[i] < x[j] || (math.IsNaN(x[i]) && !math.IsNaN(x[j]))
-//
 func (x Float64Slice) Less(i, j int) bool { return x[i] < x[j] || (isNaN(x[i]) && !isNaN(x[j])) }
 func (x Float64Slice) Swap(i, j int)      { x[i], x[j] = x[j], x[i] }
 
index 45e4192c82e16f439dd709bd02a1a9481a259040..b0c2666e7cb7324c6a48d04e7ba6f92691957d7f 100644 (file)
@@ -85,7 +85,6 @@ const digits = "0123456789abcdefghijklmnopqrstuvwxyz"
 // set, the string is appended to dst and the resulting byte slice is
 // returned as the first result value; otherwise the string is returned
 // as the second result value.
-//
 func formatBits(dst []byte, u uint64, base int, neg, append_ bool) (d []byte, s string) {
        if base < 2 || base > len(digits) {
                panic("strconv: illegal AppendInt/FormatInt base")
index b254c9360ac8b34f5e72ba10d7fc6d6d3d2a95cd..d86ebc8b5070e6c934f0c22e3b9cd148932f7f0a 100644 (file)
@@ -48,7 +48,6 @@ func NewCond(l Locker) *Cond {
 //    }
 //    ... make use of condition ...
 //    c.L.Unlock()
-//
 func (c *Cond) Wait() {
        c.checker.check()
        t := runtime_notifyListAdd(&c.notify)
index 8844314e7e9dc0bdc5e3855b50cb5789a88ce69f..e5ba257d875bf51b48b20edeb88ea09198ed93b0 100644 (file)
@@ -38,7 +38,6 @@ type Once struct {
 //
 // If f panics, Do considers it to have returned; future calls of Do return
 // without calling f.
-//
 func (o *Once) Do(f func()) {
        // Note: Here is an incorrect implementation of Do:
        //
index 9a65fbbd0bb27dd13c2f4efc2b0998fa5fab0650..ddb608088233ec7b8efd4e359388358f90afbfc2 100644 (file)
@@ -33,7 +33,6 @@ import (
 //     if err := fstest.TestFS(myFS, "file/that/should/be/present"); err != nil {
 //             t.Fatal(err)
 //     }
-//
 func TestFS(fsys fs.FS, expected ...string) error {
        if err := testFS(fsys, expected...); err != nil {
                return err
index 735982afcb2ebd31557af5d6f2c94724547a234e..44be0b6bd4b814df1b1d1ce4cddb91403fdcb531 100644 (file)
@@ -60,7 +60,6 @@ func (pos Position) String() string {
 //
 // Use GoTokens to configure the Scanner such that it accepts all Go
 // literal tokens including Go identifiers. Comments will be skipped.
-//
 const (
        ScanIdents     = 1 << -Ident
        ScanInts       = 1 << -Int
index 76dec7b358011abdc175784aae9337ab62bcec6d..d4cfcf556a40241dde41cda2545399d3972b7c72 100644 (file)
@@ -23,7 +23,6 @@ import (
 // The text itself is stored in a separate buffer; cell only describes the
 // segment's size in bytes, its width in runes, and whether it's an htab
 // ('\t') terminated cell.
-//
 type cell struct {
        size  int  // cell size in bytes
        width int  // cell width in runes
@@ -87,7 +86,6 @@ type cell struct {
 // The Writer must buffer input internally, because proper spacing
 // of one line may depend on the cells in future lines. Clients must
 // call Flush when done calling Write.
-//
 type Writer struct {
        // configuration
        output   io.Writer
@@ -207,7 +205,6 @@ const (
 //                     (for correct-looking results, tabwidth must correspond
 //                     to the tab width in the viewer displaying the result)
 //     flags           formatting control
-//
 func (b *Writer) Init(output io.Writer, minwidth, tabwidth, padding int, padchar byte, flags uint) *Writer {
        if minwidth < 0 || tabwidth < 0 || padding < 0 {
                panic("negative minwidth, tabwidth, or padding")
@@ -350,7 +347,6 @@ func (b *Writer) writeLines(pos0 int, line0, line1 int) (pos int) {
 // is the buffer position corresponding to the beginning of line0.
 // Returns the buffer position corresponding to the beginning of
 // line1 and an error, if any.
-//
 func (b *Writer) format(pos0 int, line0, line1 int) (pos int) {
        pos = pos0
        column := len(b.widths)
@@ -427,7 +423,6 @@ func (b *Writer) updateWidth() {
 // width one for formatting purposes.
 //
 // The value 0xff was chosen because it cannot appear in a valid UTF-8 sequence.
-//
 const Escape = '\xff'
 
 // Start escaped mode.
@@ -446,7 +441,6 @@ func (b *Writer) startEscape(ch byte) {
 // is assumed to be zero for formatting purposes; if it was an HTML entity,
 // its width is assumed to be one. In all other cases, the width is the
 // unicode width of the text.
-//
 func (b *Writer) endEscape() {
        switch b.endChar {
        case Escape:
@@ -464,7 +458,6 @@ func (b *Writer) endEscape() {
 
 // Terminate the current cell by adding it to the list of cells of the
 // current line. Returns the number of cells in that line.
-//
 func (b *Writer) terminateCell(htab bool) int {
        b.cell.htab = htab
        line := &b.lines[len(b.lines)-1]
@@ -526,7 +519,6 @@ var hbar = []byte("---\n")
 // Write writes buf to the writer b.
 // The only errors returned are ones encountered
 // while writing to the underlying output stream.
-//
 func (b *Writer) Write(buf []byte) (n int, err error) {
        defer b.handlePanic(&err, "Write")
 
@@ -603,7 +595,6 @@ func (b *Writer) Write(buf []byte) (n int, err error) {
 
 // NewWriter allocates and initializes a new tabwriter.Writer.
 // The parameters are the same as for the Init function.
-//
 func NewWriter(output io.Writer, minwidth, tabwidth, padding int, padchar byte, flags uint) *Writer {
        return new(Writer).Init(output, minwidth, tabwidth, padding, padchar, flags)
 }
index 1035afad72a93f4eaa2d0282c83a43e68bba5e0c..8d7d436bd079d16a764123c518c2cca831ab50cd 100644 (file)
@@ -38,7 +38,6 @@ type option struct {
 //             The operation returns the zero value for the map type's element.
 //     "missingkey=error"
 //             Execution stops immediately with an error.
-//
 func (t *Template) Option(opt ...string) *Template {
        t.init()
        for _, s := range opt {
index 33e6543289aedd5915300206e578d1220d5018eb..95fe08b772431657ab39c069a3b1e5c64b902e67 100644 (file)
@@ -87,7 +87,6 @@ import "errors"
 //
 // Some valid layouts are invalid time values for time.Parse, due to formats
 // such as _ for space padding and Z for zone information.
-//
 const (
        Layout      = "01/02 03:04:05PM '06 -0700" // The reference time, in numerical order.
        ANSIC       = "Mon Jan _2 15:04:05 2006"
index d77074c5c27572a796cc8c5e6fbe9b7f9918903a..88301ec16bbf0bc487f4632eef95beb42eed2be3 100644 (file)
@@ -123,7 +123,6 @@ import (
 // to t == u, since t.Equal uses the most accurate comparison available and
 // correctly handles the case when only one of its arguments has a monotonic
 // clock reading.
-//
 type Time struct {
        // wall and ext encode the wall time seconds, wall time nanoseconds,
        // and optional monotonic clock reading in nanoseconds.
@@ -603,7 +602,6 @@ const (
 // To convert an integer number of units to a Duration, multiply:
 //     seconds := 10
 //     fmt.Print(time.Duration(seconds)*time.Second) // prints 10s
-//
 const (
        Nanosecond  Duration = 1
        Microsecond          = 1000 * Nanosecond
index 268e457a875311bb01b34a6d7e106bae1dde4428..f4c950a883c946089b7b764f4fc245746924053d 100644 (file)
@@ -334,7 +334,6 @@ type foldPair struct {
 //     SimpleFold('1') = '1'
 //
 //     SimpleFold(-2) = -2
-//
 func SimpleFold(r rune) rune {
        if r < 0 || r > MaxRune {
                return r
index a6a255658b6da7fb4f2e7c601ea71a2cb208ab33..4a3d7feda73642dbfbd41b7d77e51e8c27b59d8b 100644 (file)
@@ -180,7 +180,6 @@ type IntegerType int
 //     hdr.Data = uintptr(unsafe.Pointer(p))
 //     hdr.Len = n
 //     s := *(*string)(unsafe.Pointer(&hdr)) // p possibly already lost
-//
 type Pointer *ArbitraryType
 
 // Sizeof takes an expression x of any type and returns the size in bytes