all: gofmt

Gofmt to update doc comments to the new formatting.

For golang/go#51082.

Change-Id: Ia9e71e7ecac75822ff43d6c7e60f512442a5fa50
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/399617
Run-TryBot: Russ Cox <rsc@golang.org>
TryBot-Result: kokoro <noreply+kokoro@google.com>
Auto-Submit: Russ Cox <rsc@golang.org>
Reviewed-by: Jonathan Amsterdam <jba@google.com>
diff --git a/cmd/pkgsite/main.go b/cmd/pkgsite/main.go
index 0ec7626..d4ccf27 100644
--- a/cmd/pkgsite/main.go
+++ b/cmd/pkgsite/main.go
@@ -11,7 +11,7 @@
 // With no arguments, pkgsite will serve docs for the module in the current
 // directory, which must have a go.mod file:
 //
-//   cd ~/repos/cue && pkgsite
+//	cd ~/repos/cue && pkgsite
 //
 // This form will also serve all of the module's required modules at their
 // required versions. You can disable serving the required modules by passing
@@ -20,13 +20,13 @@
 // You can also serve docs from your module cache, directly from the proxy
 // (it uses the GOPROXY environment variable), or both:
 //
-//   pkgsite -cache -proxy
+//	pkgsite -cache -proxy
 //
 // With either -cache or -proxy, pkgsite won't look for a module in the current
 // directory. You can still provide modules on the local filesystem by listing
 // their paths:
 //
-//   pkgsite -cache -proxy ~/repos/cue some/other/module
+//	pkgsite -cache -proxy ~/repos/cue some/other/module
 //
 // Although standard library packages will work by default, the docs can take a
 // while to appear the first time because the Go repo must be cloned and
diff --git a/devtools/cmd/seeddb/main.go b/devtools/cmd/seeddb/main.go
index 047d8d2..d729ca6 100644
--- a/devtools/cmd/seeddb/main.go
+++ b/devtools/cmd/seeddb/main.go
@@ -230,7 +230,8 @@
 
 // readSeedFile reads a file of module versions that we want to fetch for
 // seeding the database. Each line of the file should be of the form:
-//     module@version
+//
+//	module@version
 func readSeedFile(ctx context.Context, seedfile string) (_ []internal.Modver, err error) {
 	defer derrors.Wrap(&err, "readSeedFile %q", seedfile)
 	lines, err := internal.ReadFileLines(seedfile)
diff --git a/internal/database/database.go b/internal/database/database.go
index e90bfbe..b636375 100644
--- a/internal/database/database.go
+++ b/internal/database/database.go
@@ -321,7 +321,9 @@
 
 // BulkInsert constructs and executes a multi-value insert statement. The
 // query is constructed using the format:
-//   INSERT INTO <table> (<columns>) VALUES (<placeholders-for-each-item-in-values>)
+//
+//	INSERT INTO <table> (<columns>) VALUES (<placeholders-for-each-item-in-values>)
+//
 // If conflictAction is not empty, it is appended to the statement.
 //
 // The query is executed using a PREPARE statement with the provided values.
@@ -478,7 +480,8 @@
 // the values of the first column.
 //
 // Types holds the database type of each column. For example,
-//    []string{"INT", "TEXT"}
+//
+//	[]string{"INT", "TEXT"}
 //
 // Values contains one slice of values per column. (Note that this is unlike BulkInsert, which
 // takes a single slice of interleaved values.)
diff --git a/internal/database/reflect.go b/internal/database/reflect.go
index c48aaaf..e057d06 100644
--- a/internal/database/reflect.go
+++ b/internal/database/reflect.go
@@ -26,16 +26,17 @@
 // to a struct.
 //
 // Example:
-//   type Player struct { Name string; Score int }
-//   playerScanArgs := database.StructScanner(Player{})
-//   err := db.RunQuery(ctx, "SELECT name, score FROM players", func(rows *sql.Rows) error {
-//       var p Player
-//       if err := rows.Scan(playerScanArgs(&p)...); err != nil {
-//           return err
-//       }
-//       // use p
-//       return nil
-//   })
+//
+//	type Player struct { Name string; Score int }
+//	playerScanArgs := database.StructScanner(Player{})
+//	err := db.RunQuery(ctx, "SELECT name, score FROM players", func(rows *sql.Rows) error {
+//	    var p Player
+//	    if err := rows.Scan(playerScanArgs(&p)...); err != nil {
+//	        return err
+//	    }
+//	    // use p
+//	    return nil
+//	})
 func StructScanner[T any]() func(p *T) []interface{} {
 	return structScannerForType[T]()
 }
@@ -121,9 +122,10 @@
 
 // CollectStructs scans the the rows from the query into structs and returns a slice of them.
 // Example:
-//   type Player struct { Name string; Score int }
-//   var players []Player
-//   err := db.CollectStructs(ctx, &players, "SELECT name, score FROM players")
+//
+//	type Player struct { Name string; Score int }
+//	var players []Player
+//	err := db.CollectStructs(ctx, &players, "SELECT name, score FROM players")
 func CollectStructs[T any](ctx context.Context, db *DB, query string, args ...interface{}) ([]T, error) {
 	scanner := structScannerForType[T]()
 	var ts []T
diff --git a/internal/dcensus/dcensus.go b/internal/dcensus/dcensus.go
index b68b4e3..92890ce 100644
--- a/internal/dcensus/dcensus.go
+++ b/internal/dcensus/dcensus.go
@@ -209,11 +209,11 @@
 }
 
 // Customizations of ochttp views. Views are updated as follows:
-//  + ClientHost and ServerRoute are added to resp. client and server metrics.
-//    Since these are bounded cardinality in our metrics, they are useful to
-//    add additional context.
-//  + Method tags are removed. We don't have any routes that accept more than
-//    one HTTP method.
+//   - ClientHost and ServerRoute are added to resp. client and server metrics.
+//     Since these are bounded cardinality in our metrics, they are useful to
+//     add additional context.
+//   - Method tags are removed. We don't have any routes that accept more than
+//     one HTTP method.
 var (
 	ServerRequestCount = &view.View{
 		Name:        "go-discovery/http/server/request_count",
diff --git a/internal/discovery.go b/internal/discovery.go
index 2e54d3d..16e17d0 100644
--- a/internal/discovery.go
+++ b/internal/discovery.go
@@ -100,9 +100,10 @@
 // MajorVersionForModule returns the final "vN" from the module path, if any.
 // It returns the empty string if the module path is malformed.
 // Examples:
-//   "m.com" => ""
-//   "m.com/v2" => "v2"
-//   "gpkg.in/m.v1 = "v1"
+//
+//	"m.com" => ""
+//	"m.com/v2" => "v2"
+//	"gpkg.in/m.v1 = "v1"
 func MajorVersionForModule(modulePath string) string {
 	_, v, _ := module.SplitPathVersion(modulePath)
 	return strings.TrimLeft(v, "/.")
diff --git a/internal/fetch/package.go b/internal/fetch/package.go
index e6eca02..b536a1a 100644
--- a/internal/fetch/package.go
+++ b/internal/fetch/package.go
@@ -246,8 +246,8 @@
 // The logic of the go tool for ignoring directories is documented at
 // https://golang.org/cmd/go/#hdr-Package_lists_and_patterns:
 //
-// 	Directory and file names that begin with "." or "_" are ignored
-// 	by the go tool, as are directories named "testdata".
+//	Directory and file names that begin with "." or "_" are ignored
+//	by the go tool, as are directories named "testdata".
 //
 // However, even though `go list` and other commands that take package
 // wildcards will ignore these, they can still be imported and used in
diff --git a/internal/frontend/latest_version.go b/internal/frontend/latest_version.go
index e9fcb7f..e3e4b73 100644
--- a/internal/frontend/latest_version.go
+++ b/internal/frontend/latest_version.go
@@ -14,9 +14,10 @@
 
 // GetLatestInfo returns various pieces of information about the latest
 // versions of a unit and module:
-// -  The linkable form of the minor version of the unit.
-// -  The latest module path and the full unit path of any major version found given the
-//    fullPath and the modulePath.
+//   - The linkable form of the minor version of the unit.
+//   - The latest module path and the full unit path of any major version found given the
+//     fullPath and the modulePath.
+//
 // It returns empty strings on error.
 // It is intended to be used as an argument to middleware.LatestVersions.
 func (s *Server) GetLatestInfo(ctx context.Context, unitPath, modulePath string, latestUnitMeta *internal.UnitMeta) internal.LatestInfo {
diff --git a/internal/frontend/overview.go b/internal/frontend/overview.go
index 47ede784..4012f1c 100644
--- a/internal/frontend/overview.go
+++ b/internal/frontend/overview.go
@@ -124,9 +124,13 @@
 //
 // In addition, GitHub will translate absolute non-raw links to image files to raw links.
 // For example, when GitHub renders a README with
-//    <img src="https://github.com/gobuffalo/buffalo/blob/master/logo.svg">
+//
+//	<img src="https://github.com/gobuffalo/buffalo/blob/master/logo.svg">
+//
 // it rewrites it to
-//    <img src="https://github.com/gobuffalo/buffalo/raw/master/logo.svg">
+//
+//	<img src="https://github.com/gobuffalo/buffalo/raw/master/logo.svg">
+//
 // (replacing "blob" with "raw").
 // We do that too.
 func translateLink(dest string, info *source.Info, useRaw bool, readme *internal.Readme) string {
diff --git a/internal/frontend/readme.go b/internal/frontend/readme.go
index 60ff522..a54211e 100644
--- a/internal/frontend/readme.go
+++ b/internal/frontend/readme.go
@@ -61,7 +61,7 @@
 // readme's original styling is preserved in the html by giving headings a css
 // class styled identical to their original heading level.
 //
-//  The extracted links are for display outside of the readme contents.
+// The extracted links are for display outside of the readme contents.
 //
 // This function is exported for use by external tools.
 func ProcessReadme(ctx context.Context, u *internal.Unit) (_ *Readme, err error) {
diff --git a/internal/frontend/urlinfo.go b/internal/frontend/urlinfo.go
index cadac79..5420dc6 100644
--- a/internal/frontend/urlinfo.go
+++ b/internal/frontend/urlinfo.go
@@ -65,19 +65,19 @@
 // of three forms, and we divide it into three parts: a full path, a module
 // path, and a version.
 //
-// 1. The path has no '@', like github.com/hashicorp/vault/api.
-//    This is the full path. The module path is unknown. So is the version, so we
-//    treat it as the latest version for whatever the path denotes.
+//  1. The path has no '@', like github.com/hashicorp/vault/api.
+//     This is the full path. The module path is unknown. So is the version, so we
+//     treat it as the latest version for whatever the path denotes.
 //
-// 2. The path has "@version" at the end, like github.com/hashicorp/vault/api@v1.2.3.
-//    We split this at the '@' into a full path (github.com/hashicorp/vault/api)
-//    and version (v1.2.3); the module path is still unknown.
+//  2. The path has "@version" at the end, like github.com/hashicorp/vault/api@v1.2.3.
+//     We split this at the '@' into a full path (github.com/hashicorp/vault/api)
+//     and version (v1.2.3); the module path is still unknown.
 //
-// 3. The path has "@version" in the middle, like github.com/hashicorp/vault@v1.2.3/api.
-//    (We call this the "canonical" form of a path.)
-//    We remove the version to get the full path, which is again
-//    github.com/hashicorp/vault/api. The version is v1.2.3, and the module path is
-//    the part before the '@', github.com/hashicorp/vault.
+//  3. The path has "@version" in the middle, like github.com/hashicorp/vault@v1.2.3/api.
+//     (We call this the "canonical" form of a path.)
+//     We remove the version to get the full path, which is again
+//     github.com/hashicorp/vault/api. The version is v1.2.3, and the module path is
+//     the part before the '@', github.com/hashicorp/vault.
 //
 // In one case, we do a little more than parse the urlPath into parts: if the full path
 // could be a part of the standard library (because it has no '.'), we assume it
diff --git a/internal/frontend/versions.go b/internal/frontend/versions.go
index 1c685df..28c4fe0 100644
--- a/internal/frontend/versions.go
+++ b/internal/frontend/versions.go
@@ -124,10 +124,11 @@
 //
 // For example: if we're considering package foo.com/v3/bar/baz, and encounter
 // module version foo.com/bar/v2, we do the following:
-//   1) Start with the v1Path foo.com/bar/baz.
-//   2) Trim off the version series path foo.com/bar to get 'baz'.
-//   3) Join with the versioned module path foo.com/bar/v2 to get
-//      foo.com/bar/v2/baz.
+//  1. Start with the v1Path foo.com/bar/baz.
+//  2. Trim off the version series path foo.com/bar to get 'baz'.
+//  3. Join with the versioned module path foo.com/bar/v2 to get
+//     foo.com/bar/v2/baz.
+//
 // ...being careful about slashes along the way.
 func pathInVersion(v1Path string, mi *internal.ModuleInfo) string {
 	suffix := internal.Suffix(v1Path, mi.SeriesPath())
diff --git a/internal/godoc/codec/codec_test.go b/internal/godoc/codec/codec_test.go
index 61c9276..c93f941 100644
--- a/internal/godoc/codec/codec_test.go
+++ b/internal/godoc/codec/codec_test.go
@@ -265,7 +265,9 @@
 }
 
 // The following three functions were generated with
-//   Generate(os.Stdout, "p", node{})
+//
+//	Generate(os.Stdout, "p", node{})
+//
 // and pasted here. They should be kept in sync
 // with the output of Generate.
 func encode_node(e *Encoder, x *node) {
diff --git a/internal/godoc/codec/doc.go b/internal/godoc/codec/doc.go
index 28980ba..b628b22 100644
--- a/internal/godoc/codec/doc.go
+++ b/internal/godoc/codec/doc.go
@@ -10,7 +10,7 @@
 other pointer types or sub-slices). These features are sufficient for
 encoding the structures of the go/ast package, which is its sole purpose.
 
-Encoding Scheme
+# Encoding Scheme
 
 Every encoded value begins with a single byte that describes what (if
 anything) follows. There is enough information to skip over the value, since
@@ -32,7 +32,8 @@
 followed by N bytes of data. This is used to represent strings and byte
 slices, as well numbers bigger than can fit into the initial byte. For
 example, the string "hi" is represented as:
-  nBytes 2 'h' 'i'
+
+	nBytes 2 'h' 'i'
 
 Unsigned integers that can't fit into the initial byte are encoded as byte
 sequences of length 4 or 8, holding little-endian uint32 or uint64 values. We
@@ -43,7 +44,8 @@
 
 The nValues code is for sequences of values whose size is known beforehand,
 like a Go slice or array. The slice []string{"hi", "bye"} is encoded as
-  nValues 2 nBytes 2 'h' 'i' nBytes 3 'b' 'y' 'e'
+
+	nValues 2 nBytes 2 'h' 'i' nBytes 3 'b' 'y' 'e'
 
 The ref code is used to refer to an earlier encoded value. It is followed by
 a uint denoting the index data of the value to use.
diff --git a/internal/godoc/dochtml/internal/render/linkify.go b/internal/godoc/dochtml/internal/render/linkify.go
index 9e33743..cd9cdc7 100644
--- a/internal/godoc/dochtml/internal/render/linkify.go
+++ b/internal/godoc/dochtml/internal/render/linkify.go
@@ -264,7 +264,7 @@
 
 // formatLineHTML formats the line as HTML-annotated text.
 // URLs and Go identifiers are linked to corresponding declarations.
-// If pre is true no conversion of `` or '' to “ and ” is performed.
+// If pre is true no conversion of doubled ` and ' to “ and ” is performed.
 func (r *Renderer) formatLineHTML(line string, pre bool) safehtml.HTML {
 	var htmls []safehtml.HTML
 	var numQuotes int
@@ -694,7 +694,7 @@
 
 var unicodeQuoteReplacer = strings.NewReplacer("``", ulquo, "''", urquo)
 
-// convertQuotes turns `` into “ and '' into ”.
+// convertQuotes turns doubled ` and ' into “ and ”.
 func convertQuotes(text string) string {
 	return unicodeQuoteReplacer.Replace(text)
 }
diff --git a/internal/godoc/dochtml/internal/render/render.go b/internal/godoc/dochtml/internal/render/render.go
index 0378b31..383a2ba 100644
--- a/internal/godoc/dochtml/internal/render/render.go
+++ b/internal/godoc/dochtml/internal/render/render.go
@@ -144,6 +144,7 @@
 // into a hyperlink to the declaration of that identifier.
 //
 // This returns formatted HTML with:
+//
 //	<p>                elements for plain documentation text
 //	<pre>              elements for preformatted text
 //	<h3 id="hdr-XXX">  elements for headings with the "id" attribute
@@ -171,6 +172,7 @@
 // This formats documentation HTML according to the same rules as DocHTML.
 //
 // This formats declaration HTML with:
+//
 //	<pre>                       element wrapping the entire declaration
 //	<span id="X" data-kind="K"> elements for many top-level declarations
 //	<span class="comment">      elements for every Go comment
@@ -191,6 +193,7 @@
 // or assignment-compatible to ast.Expr, ast.Decl, ast.Spec, or ast.Stmt.
 //
 // This returns formatted HTML with:
+//
 //	<pre>                   element wrapping entire block
 //	<span class="comment">  elements for every Go comment
 //
diff --git a/internal/godoc/internal/doc/comment.go b/internal/godoc/internal/doc/comment.go
index 75b3726..7537614 100644
--- a/internal/godoc/internal/doc/comment.go
+++ b/internal/godoc/internal/doc/comment.go
@@ -30,7 +30,7 @@
 )
 
 // Escape comment text for HTML. If nice is set,
-// also turn `` into &ldquo; and '' into &rdquo;.
+// also turn doubled ` and ' into &ldquo; and &rdquo;.
 func commentEscape(w io.Writer, text string, nice bool) {
 	if nice {
 		// In the first pass, we convert `` and '' into their unicode equivalents.
@@ -94,8 +94,8 @@
 // into a link). Go identifiers that appear in the words map are italicized; if
 // the corresponding map value is not the empty string, it is considered a URL
 // and the word is converted into a link. If nice is set, the remaining text's
-// appearance is improved where it makes sense (e.g., `` is turned into &ldquo;
-// and '' into &rdquo;).
+// appearance is improved where it makes sense (e.g., doubled ` and ' is turned
+// into &ldquo; and &rdquo;).
 func emphasize(w io.Writer, line string, words map[string]string, nice bool) {
 	for {
 		m := matchRx.FindStringSubmatchIndex(line)
diff --git a/internal/godoc/internal/doc/doc.go b/internal/godoc/internal/doc/doc.go
index 8f684ee..2c65768 100644
--- a/internal/godoc/internal/doc/doc.go
+++ b/internal/godoc/internal/doc/doc.go
@@ -114,7 +114,6 @@
 // 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 @@
 //
 // 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 {
diff --git a/internal/godoc/internal/doc/example.go b/internal/godoc/internal/doc/example.go
index 792ba56..713945f 100644
--- a/internal/godoc/internal/doc/example.go
+++ b/internal/godoc/internal/doc/example.go
@@ -457,13 +457,12 @@
 //
 // The classification process is ambiguous in some cases:
 //
-// 	- ExampleFoo_Bar matches a type named Foo_Bar
-// 	  or a method named Foo.Bar.
-// 	- ExampleFoo_bar matches a type named Foo_bar
-// 	  or Foo (with a "bar" suffix).
+//   - ExampleFoo_Bar matches a type named Foo_Bar
+//     or a method named Foo.Bar.
+//   - ExampleFoo_bar matches a type named Foo_bar
+//     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
diff --git a/internal/godoc/internal/doc/exports.go b/internal/godoc/internal/doc/exports.go
index 671c622..655e889 100644
--- a/internal/godoc/internal/doc/exports.go
+++ b/internal/godoc/internal/doc/exports.go
@@ -13,7 +13,6 @@
 
 // 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 @@
 }
 
 // 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 @@
 // 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 @@
 }
 
 // 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 @@
 // 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 @@
 // 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 @@
 }
 
 // fileExports removes unexported declarations from src in place.
-//
 func (r *reader) fileExports(src *ast.File) {
 	j := 0
 	for _, d := range src.Decls {
diff --git a/internal/godoc/internal/doc/filter.go b/internal/godoc/internal/doc/filter.go
index 9904da1..f8d3e1f 100644
--- a/internal/godoc/internal/doc/filter.go
+++ b/internal/godoc/internal/doc/filter.go
@@ -97,7 +97,6 @@
 
 // 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)
diff --git a/internal/godoc/internal/doc/reader.go b/internal/godoc/internal/doc/reader.go
index 16b4c41..6a2cf10 100644
--- a/internal/godoc/internal/doc/reader.go
+++ b/internal/godoc/internal/doc/reader.go
@@ -22,12 +22,10 @@
 
 // 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:
@@ -66,7 +64,6 @@
 // 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 != "" {
@@ -102,7 +99,6 @@
 // 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 {
@@ -123,7 +119,6 @@
 
 // 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:
@@ -152,7 +147,6 @@
 // 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
@@ -177,7 +171,6 @@
 // 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
 
@@ -207,7 +200,6 @@
 // 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
@@ -230,7 +222,6 @@
 // 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 {
@@ -274,7 +265,6 @@
 }
 
 // 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.
@@ -348,7 +338,6 @@
 }
 
 // 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) {
@@ -365,7 +354,6 @@
 }
 
 // readType processes a type declaration.
-//
 func (r *reader) readType(decl *ast.GenDecl, spec *ast.TypeSpec) {
 	typ := r.lookupType(spec.Name.Name)
 	if typ == nil {
@@ -401,13 +389,11 @@
 }
 
 // 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 {
@@ -501,7 +487,6 @@
 )
 
 // 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 {
@@ -527,7 +512,6 @@
 // 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
@@ -547,7 +531,6 @@
 }
 
 // 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 {
@@ -697,7 +680,6 @@
 }
 
 // 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 {
@@ -721,7 +703,6 @@
 }
 
 // computeMethodSets determines the actual method sets for each type encountered.
-//
 func (r *reader) computeMethodSets() {
 	for _, t := range r.types {
 		// collect embedded methods for t
@@ -747,7 +728,6 @@
 // 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)
@@ -814,7 +794,6 @@
 }
 
 // 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 {
@@ -907,7 +886,6 @@
 
 // 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 {
diff --git a/internal/godoc/internal/doc/synopsis.go b/internal/godoc/internal/doc/synopsis.go
index 3fa1616..ca607cc 100644
--- a/internal/godoc/internal/doc/synopsis.go
+++ b/internal/godoc/internal/doc/synopsis.go
@@ -12,7 +12,6 @@
 // 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 @@
 // 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 {
diff --git a/internal/licenses/licenses.go b/internal/licenses/licenses.go
index f8ac464..d19a726 100644
--- a/internal/licenses/licenses.go
+++ b/internal/licenses/licenses.go
@@ -8,14 +8,16 @@
 // redistributable.
 //
 // Example (modproxy):
-//   d := licenses.NewDetector(modulePath, version, zipReader, log.Infof)
-//   modRedist := d.ModuleIsRedistributable()
+//
+//	d := licenses.NewDetector(modulePath, version, zipReader, log.Infof)
+//	modRedist := d.ModuleIsRedistributable()
 //
 // Example (discovery):
-//   d := licenses.NewDetector(modulePath, version, zipReader, log.Infof)
-//   modRedist := d.ModuleIsRedistributable()
-//   lics := d.AllLicenses()
-//   pkgRedist, pkgMetas := d.PackageInfo(pkgSubdir)
+//
+//	d := licenses.NewDetector(modulePath, version, zipReader, log.Infof)
+//	modRedist := d.ModuleIsRedistributable()
+//	lics := d.AllLicenses()
+//	pkgRedist, pkgMetas := d.PackageInfo(pkgSubdir)
 package licenses
 
 import (
@@ -468,9 +470,9 @@
 
 // isVendoredFile reports if the given file is in a proper subdirectory nested
 // under a 'vendor' directory, to allow for Go packages named 'vendor'.
-//
-// e.g. isVendoredFile("vendor/LICENSE") == false, and
-//      isVendoredFile("vendor/foo/LICENSE") == true
+// For example:
+//   - isVendoredFile("vendor/LICENSE") == false, and
+//   - isVendoredFile("vendor/foo/LICENSE") == true.
 func isVendoredFile(name string) bool {
 	var vendorOffset int
 	if strings.HasPrefix(name, "vendor/") {
diff --git a/internal/middleware/stats.go b/internal/middleware/stats.go
index 8e1f2d2..c333d9d 100644
--- a/internal/middleware/stats.go
+++ b/internal/middleware/stats.go
@@ -49,7 +49,9 @@
 
 // ElapsedStat records as a stat the elapsed time for a
 // function execution. Invoke like so:
-//   defer ElapsedStat(ctx, "FunctionName")()
+//
+//	defer ElapsedStat(ctx, "FunctionName")()
+//
 // The resulting stat will be called "FunctionName ms" and will
 // be the wall-clock execution time of the function in milliseconds.
 func ElapsedStat(ctx context.Context, name string) func() {
diff --git a/internal/postgres/search.go b/internal/postgres/search.go
index 1c47204..3c71605 100644
--- a/internal/postgres/search.go
+++ b/internal/postgres/search.go
@@ -249,13 +249,14 @@
 
 // scoreExpr is the expression that computes the search score.
 // It is the product of:
-// - The Postgres ts_rank score, based the relevance of the document to the query.
-// - The log of the module's popularity, estimated by the number of importing packages.
-//   The log factor contains exp(1) so that it is always >= 1. Taking the log
-//   of imported_by_count instead of using it directly makes the effect less
-//   dramatic: being 2x as popular only has an additive effect.
-// - A penalty factor for non-redistributable modules, since a lot of
-//   details cannot be displayed.
+//   - The Postgres ts_rank score, based the relevance of the document to the query.
+//   - The log of the module's popularity, estimated by the number of importing packages.
+//     The log factor contains exp(1) so that it is always >= 1. Taking the log
+//     of imported_by_count instead of using it directly makes the effect less
+//     dramatic: being 2x as popular only has an additive effect.
+//   - A penalty factor for non-redistributable modules, since a lot of
+//     details cannot be displayed.
+//
 // The first argument to ts_rank is an array of weights for the four tsvector sections,
 // in the order D, C, B, A.
 // The weights below match the defaults except for B.
diff --git a/internal/postgres/searchdoc.go b/internal/postgres/searchdoc.go
index 5abbe69..b78fffa 100644
--- a/internal/postgres/searchdoc.go
+++ b/internal/postgres/searchdoc.go
@@ -120,9 +120,10 @@
 // summaryReplacements is used to replace words with other words.
 // It is used by processWord, below.
 // Example key-value pairs:
-//   "deleteMe": nil					 // removes "deleteMe"
-//   "rand": []string{"random"}			 // replace "rand" with "random"
-//   "utf-8": []string{"utf-8", "utf8"}  // add "utf8" whenever "utf-8" is seen
+//
+//	"deleteMe": nil					 // removes "deleteMe"
+//	"rand": []string{"random"}			 // replace "rand" with "random"
+//	"utf-8": []string{"utf-8", "utf8"}  // add "utf8" whenever "utf-8" is seen
 var summaryReplacements = map[string][]string{
 	"postgres":   {"postgres", "postgresql"},
 	"postgresql": {"postgres", "postgresql"},
diff --git a/internal/postgres/test_helper.go b/internal/postgres/test_helper.go
index 23366f1..1f990a0 100644
--- a/internal/postgres/test_helper.go
+++ b/internal/postgres/test_helper.go
@@ -101,9 +101,10 @@
 // return value of the function should be called in a defer statement to release the database.
 // For example:
 //
-//    func Test(t *testing.T) {
-//        db, release := acquire(t)
-//        defer release()
+//	func Test(t *testing.T) {
+//	    db, release := acquire(t)
+//	    defer release()
+//	}
 func RunDBTestsInParallel(dbBaseName string, numDBs int, m *testing.M, acquirep *func(*testing.T) (*DB, func())) {
 	start := time.Now()
 	database.QueryLoggingDisabled = true
diff --git a/internal/postgres/unit.go b/internal/postgres/unit.go
index 200d595..234990c 100644
--- a/internal/postgres/unit.go
+++ b/internal/postgres/unit.go
@@ -26,14 +26,17 @@
 // If the module is unknown, pass internal.UnknownModulePath; if the version is unknown, pass
 // internal.LatestVersion.
 //
-// The rules for picking the best are:
+// The rules for picking the best are as follows.
+//
 // 1. If the version is known but the module path is not, choose the longest module path
-//    at that version that contains fullPath.
+// at that version that contains fullPath.
+//
 // 2. Otherwise, find the latest "good" version (in the modules table) that contains fullPath.
-//    a. First, follow the algorithm of the go command: prefer longer module paths, and
-//       find the latest unretracted version, using semver but preferring release to pre-release.
-//    b. If no modules have latest-version information, find the latest by sorting the versions
-//       we do have: again first by module path length, then by version.
+//
+//	a. First, follow the algorithm of the go command: prefer longer module paths, and
+//	   find the latest unretracted version, using semver but preferring release to pre-release.
+//	b. If no modules have latest-version information, find the latest by sorting the versions
+//	   we do have: again first by module path length, then by version.
 func (db *DB) GetUnitMeta(ctx context.Context, fullPath, requestedModulePath, requestedVersion string) (_ *internal.UnitMeta, err error) {
 	defer derrors.WrapStack(&err, "DB.GetUnitMeta(ctx, %q, %q, %q)", fullPath, requestedModulePath, requestedVersion)
 	defer middleware.ElapsedStat(ctx, "DB.GetUnitMeta")()
diff --git a/internal/source/source.go b/internal/source/source.go
index 499a80c..86430f2 100644
--- a/internal/source/source.go
+++ b/internal/source/source.go
@@ -410,10 +410,14 @@
 // moduleOrRepoPath. It is not when the argument is a module path that uses the
 // go command's general syntax, which ends in a ".vcs" (e.g. ".git", ".hg") that
 // is neither part of the repo nor the suffix. For example, if the argument is
-//   github.com/a/b/c
+//
+//	github.com/a/b/c
+//
 // then repo="github.com/a/b" and relativeModulePath="c"; together they make up the module path.
 // But if the argument is
-//   example.com/a/b.git/c
+//
+//	example.com/a/b.git/c
+//
 // then repo="example.com/a/b" and relativeModulePath="c"; the ".git" is omitted, since it is neither
 // part of the repo nor part of the relative path to the module within the repo.
 func matchStatic(moduleOrRepoPath string) (repo, relativeModulePath string, _ urlTemplates, transformCommit transformCommitFunc, _ error) {
@@ -783,14 +787,13 @@
 //
 // The template variables are:
 //
-// 	• {repo}       - Repository URL with "https://" prefix ("https://example.com/myrepo").
-// 	• {importPath} - Package import path ("example.com/myrepo/mypkg").
-// 	• {commit}     - Tag name or commit hash corresponding to version ("v0.1.0" or "1234567890ab").
-// 	• {dir}        - Path to directory of the package, relative to repo root ("mypkg").
-// 	• {file}       - Path to file containing the identifier, relative to repo root ("mypkg/file.go").
-// 	• {base}       - Base name of file containing the identifier, including file extension ("file.go").
-// 	• {line}       - Line number for the identifier ("41").
-//
+//   - {repo}       - Repository URL with "https://" prefix ("https://example.com/myrepo").
+//   - {importPath} - Package import path ("example.com/myrepo/mypkg").
+//   - {commit}     - Tag name or commit hash corresponding to version ("v0.1.0" or "1234567890ab").
+//   - {dir}        - Path to directory of the package, relative to repo root ("mypkg").
+//   - {file}       - Path to file containing the identifier, relative to repo root ("mypkg/file.go").
+//   - {base}       - Base name of file containing the identifier, including file extension ("file.go").
+//   - {line}       - Line number for the identifier ("41").
 type urlTemplates struct {
 	Repo      string `json:",omitempty"` // Optional URL template for the repository home page, with {repo}. If left empty, a default template "{repo}" is used.
 	Directory string // URL template for a directory, with {repo}, {importPath}, {commit}, {dir}.
diff --git a/internal/stdlib/stdlib.go b/internal/stdlib/stdlib.go
index 654773a..cf0d155 100644
--- a/internal/stdlib/stdlib.go
+++ b/internal/stdlib/stdlib.go
@@ -63,12 +63,13 @@
 // tag doesn't correspond to a Go release or beta tag. In special cases,
 // when the tag specified is either `latest` or `master` it will return the tag.
 // Examples:
-//   "go1" => "v1.0.0"
-//   "go1.2" => "v1.2.0"
-//   "go1.13beta1" => "v1.13.0-beta.1"
-//   "go1.9rc2" => "v1.9.0-rc.2"
-//   "latest" => "latest"
-//   "master" => "master"
+//
+//	"go1" => "v1.0.0"
+//	"go1.2" => "v1.2.0"
+//	"go1.13beta1" => "v1.13.0-beta.1"
+//	"go1.9rc2" => "v1.9.0-rc.2"
+//	"latest" => "latest"
+//	"master" => "master"
 func VersionForTag(tag string) string {
 	// Special cases for go1.
 	if tag == "go1" {
@@ -212,7 +213,8 @@
 
 // WithTestData arranges for this package to use a testing version of the Go repo.
 // The returned function restores the previous state. Use with defer:
-//   defer WithTestData()()
+//
+//	defer WithTestData()()
 func WithTestData() func() {
 	return withGoRepo(&testGoRepo{})
 }
diff --git a/internal/symbol/generate.go b/internal/symbol/generate.go
index 0bdaefd..3fd4e0d 100644
--- a/internal/symbol/generate.go
+++ b/internal/symbol/generate.go
@@ -162,7 +162,6 @@
 // except we accept pkgPath as an argument to check that pkg.ImportPath ==
 // pkgPath and retry on various go list errors.
 //
-//
 // loadImports populates w with information about the packages in the standard
 // library and the packages they themselves import in w's build context.
 //
diff --git a/internal/testing/sample/sample.go b/internal/testing/sample/sample.go
index c2fcf9d..1576ab1 100644
--- a/internal/testing/sample/sample.go
+++ b/internal/testing/sample/sample.go
@@ -158,7 +158,8 @@
 //
 // This makes it easier to work with timestamps in PostgreSQL, which have
 // Microsecond precision:
-//   https://www.postgresql.org/docs/9.1/datatype-datetime.html
+//
+//	https://www.postgresql.org/docs/9.1/datatype-datetime.html
 func NowTruncated() time.Time {
 	return time.Now().In(time.UTC).Truncate(time.Microsecond)
 }
diff --git a/internal/version/version.go b/internal/version/version.go
index aed54c3..0d4a955 100644
--- a/internal/version/version.go
+++ b/internal/version/version.go
@@ -143,7 +143,9 @@
 // appendNumericPrefix appends a string representing n to dst.
 // n is the length of a digit string; the value we append is a prefix for the
 // digit string s such that
-//   prefix1 + s1 < prefix2 + s2
+//
+//	prefix1 + s1 < prefix2 + s2
+//
 // if and only if the integer denoted by s1 is less than the one denoted by s2.
 // In other words, prefix + s is a string that can be compared with other such
 // strings while preserving the ordering of the numbers.
@@ -151,13 +153,15 @@
 // If n==1, there is no prefix. (Single-digit numbers are unchanged.)
 // Otherwise, the prefix is a sequence of lower-case letters encoding n.
 // Examples:
-//   n    prefix
-//   1    <none>
-//   2    a
-//   27   z
-//   28   za
-//   53   zz
-//   54   zza
+//
+//	n    prefix
+//	1    <none>
+//	2    a
+//	27   z
+//	28   za
+//	53   zz
+//	54   zza
+//
 // This encoding depends on the ASCII properties that:
 // - digits are ordered numerically
 // - letters are ordered alphabetically
diff --git a/internal/worker/server.go b/internal/worker/server.go
index a7ef858..e6b07ad 100644
--- a/internal/worker/server.go
+++ b/internal/worker/server.go
@@ -370,6 +370,7 @@
 // is assumed to have either of the following two structures:
 //   - <module>/@v/<version>
 //   - <module>/@latest
+//
 // (this is symmetric with the proxy url scheme)
 func parseModulePathAndVersion(requestPath string) (string, string, error) {
 	p := strings.TrimPrefix(requestPath, "/")