all: gofmt
Gofmt to update doc comments to the new formatting.
For golang/go#51082.
Change-Id: Ibc40b6ada59a562e31a363dbe15e05d5f246874c
Reviewed-on: https://go-review.googlesource.com/c/perf/+/399600
Run-TryBot: Russ Cox <rsc@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
Auto-Submit: Russ Cox <rsc@golang.org>
Reviewed-by: Michael Pratt <mpratt@google.com>
diff --git a/analysis/app/parse.go b/analysis/app/parse.go
index 0286a8f..4afc3d7 100644
--- a/analysis/app/parse.go
+++ b/analysis/app/parse.go
@@ -8,9 +8,11 @@
// parseQueryString splits a user-entered query into one or more storage server queries.
// The supported query formats are:
-// prefix | one vs two - parsed as "prefix", {"one", "two"}
-// prefix one vs two - parsed as "", {"prefix one", "two"}
-// anything else - parsed as "", {"anything else"}
+//
+// prefix | one vs two - parsed as "prefix", {"one", "two"}
+// prefix one vs two - parsed as "", {"prefix one", "two"}
+// anything else - parsed as "", {"anything else"}
+//
// The vs and | separators must not be quoted.
func parseQueryString(q string) (string, []string) {
var queries []string
diff --git a/analysis/app/trend.go b/analysis/app/trend.go
index dfda67a..312fff6 100644
--- a/analysis/app/trend.go
+++ b/analysis/app/trend.go
@@ -321,12 +321,16 @@
// aggResults pivots the table, taking the columns in Values and making a new column for each distinct value in Across.
// aggResults("in", []string{"value1", "value2"} will reshape a table like
-// in value1 value2
-// one 1 2
-// two 3 4
+//
+// in value1 value2
+// one 1 2
+// two 3 4
+//
// and will turn in into a table like
-// one/value1 one/value2 two/value1 two/value2
-// 1 2 3 4
+//
+// one/value1 one/value2 two/value1 two/value2
+// 1 2 3 4
+//
// across columns must be []string, and value columns must be []float64.
type aggResults struct {
// Across is the name of the column whose values are the column prefix.
diff --git a/analysis/localperf/app.go b/analysis/localperf/app.go
index a82b0c9..61b0cbe 100644
--- a/analysis/localperf/app.go
+++ b/analysis/localperf/app.go
@@ -6,7 +6,7 @@
//
// Usage:
//
-// localperf [-addr address] [-storage url] [-base_dir ../appengine]
+// localperf [-addr address] [-storage url] [-base_dir ../appengine]
package main
import (
diff --git a/benchfmt/internal/bytesconv/atof.go b/benchfmt/internal/bytesconv/atof.go
index 5ffdbaa..31b26f5 100644
--- a/benchfmt/internal/bytesconv/atof.go
+++ b/benchfmt/internal/bytesconv/atof.go
@@ -407,9 +407,11 @@
// If possible to convert decimal representation to 64-bit float f exactly,
// entirely in floating-point math, do so, avoiding the expense of decimalToFloatBits.
// Three common cases:
+//
// value is exact integer
// value is exact integer * exact power of ten
// value is exact integer / exact power of ten
+//
// These all produce potentially inexact but correctly rounded answers.
func atof64exact(mantissa uint64, exp int, neg bool) (f float64, ok bool) {
if mantissa>>float64info.mantbits != 0 {
diff --git a/benchproc/keyheader.go b/benchproc/keyheader.go
index 42ee375..721b092 100644
--- a/benchproc/keyheader.go
+++ b/benchproc/keyheader.go
@@ -17,19 +17,19 @@
//
// For example, given four keys:
//
-// K[0] = a:1 b:1 c:1
-// K[1] = a:1 b:1 c:2
-// K[2] = a:2 b:2 c:2
-// K[3] = a:2 b:3 c:3
+// K[0] = a:1 b:1 c:1
+// K[1] = a:1 b:1 c:2
+// K[2] = a:2 b:2 c:2
+// K[3] = a:2 b:3 c:3
//
// the KeyHeader is as follows:
//
-// Level 0 a:1 a:2
-// | / \
-// Level 1 b:1 b:2 b:3
-// / \ | |
-// Level 2 c:1 c:2 c:2 c:3
-// K[0] K[1] K[2] K[3]
+// Level 0 a:1 a:2
+// | / \
+// Level 1 b:1 b:2 b:3
+// / \ | |
+// Level 2 c:1 c:2 c:2 c:3
+// K[0] K[1] K[2] K[3]
type KeyHeader struct {
// Keys is the sequence of keys at the leaf level of this tree.
// Each level subdivides this sequence.
diff --git a/benchproc/syntax/doc.go b/benchproc/syntax/doc.go
index 160e5f0..81afcdd 100644
--- a/benchproc/syntax/doc.go
+++ b/benchproc/syntax/doc.go
@@ -11,7 +11,7 @@
// several field, including a name, name-based configuration, and
// file configuration pairs ("key: value" lines).
//
-// Keys
+// # Keys
//
// Filters and projections share a common set of keys for referring to
// these fields of a benchmark result:
@@ -54,45 +54,45 @@
// - ".file" refers to the input file provided on the command line
// (for command-line tools that use benchfmt.Files).
//
-// Filters
+// # Filters
//
// Filters are boolean expressions that match or exclude benchmark
// results or individual measurements.
//
// Filters are built from key-value terms:
//
-// key:value - Match if key's value is exactly "value".
-// key:"value" - Same, but value is a double-quoted Go string that
-// may contain spaces or other special characters.
-// "key":value - Keys may also be double-quoted.
-// key:/regexp/ - Match if key's value matches a regular expression.
-// key:(val1 OR val2 OR ...)
-// - Short-hand for key:val1 OR key:val2. Values may be
-// double-quoted strings or regexps.
-// * - Match everything.
+// key:value - Match if key's value is exactly "value".
+// key:"value" - Same, but value is a double-quoted Go string that
+// may contain spaces or other special characters.
+// "key":value - Keys may also be double-quoted.
+// key:/regexp/ - Match if key's value matches a regular expression.
+// key:(val1 OR val2 OR ...)
+// - Short-hand for key:val1 OR key:val2. Values may be
+// double-quoted strings or regexps.
+// * - Match everything.
//
// These terms can be combined into larger expressions as follows:
//
-// x y ... - Match if x, y, etc. all match.
-// x AND y - Same as x y.
-// x OR y - Match if x or y match.
-// -x - Match if x does not match.
-// (...) - Subexpression.
+// x y ... - Match if x, y, etc. all match.
+// x AND y - Same as x y.
+// x OR y - Match if x or y match.
+// -x - Match if x does not match.
+// (...) - Subexpression.
//
// Precise syntax:
//
-// expr = andExpr {"OR" andExpr}
-// andExpr = match {"AND"? match}
-// match = "(" expr ")"
-// | "-" match
-// | "*"
-// | key ":" value
-// | key ":" "(" value {"OR" value} ")"
-// key = word
-// value = word
-// | "/" regexp "/"
+// expr = andExpr {"OR" andExpr}
+// andExpr = match {"AND"? match}
+// match = "(" expr ")"
+// | "-" match
+// | "*"
+// | key ":" value
+// | key ":" "(" value {"OR" value} ")"
+// key = word
+// value = word
+// | "/" regexp "/"
//
-// Projections
+// # Projections
//
// A projection expresses how to extract a tuple of data from a
// benchmark result, as well as a sort order for projected tuples.
@@ -115,18 +115,18 @@
//
// Precise syntax:
//
-// expr = part {","? part}
-// part = key
-// | key "@" order
-// | key "@" "(" word {word} ")"
-// key = word
-// order = word
+// expr = part {","? part}
+// part = key
+// | key "@" order
+// | key "@" "(" word {word} ")"
+// key = word
+// order = word
//
-// Common syntax
+// # Common syntax
//
// Filters and projections share the following common base syntax:
//
-// word = bareWord
-// | double-quoted Go string
-// bareWord = [^-*"():@,][^ ():@,]*
+// word = bareWord
+// | double-quoted Go string
+// bareWord = [^-*"():@,][^ ():@,]*
package syntax
diff --git a/benchseries/benchseries.go b/benchseries/benchseries.go
index 889c490..8b7f110 100644
--- a/benchseries/benchseries.go
+++ b/benchseries/benchseries.go
@@ -844,8 +844,9 @@
// KSov returns the size-adjusted Kolmogorov-Smirnov statistic,
// equal to D_{n,m} / sqrt((n+m)/n*m). The result can be compared
// to c(α) where α is the level at which the null hypothesis is rejected.
-// α: 0.2 0.15 0.10 0.05 0.025 0.01 0.005 0.001
-// c(α): 1.073 1.138 1.224 1.358 1.48 1.628 1.731 1.949
+//
+// α: 0.2 0.15 0.10 0.05 0.025 0.01 0.005 0.001
+// c(α): 1.073 1.138 1.224 1.358 1.48 1.628 1.731 1.949
//
// see
// https://en.wikipedia.org/wiki/Kolmogorov%E2%80%93Smirnov_test#Two-sample_Kolmogorov%E2%80%93Smirnov_test
diff --git a/cmd/benchsave/benchsave.go b/cmd/benchsave/benchsave.go
index 6474b61..51f32c4 100644
--- a/cmd/benchsave/benchsave.go
+++ b/cmd/benchsave/benchsave.go
@@ -9,7 +9,7 @@
// benchsave [-v] [-header file] [-server url] file...
//
// Each input file should contain the output from one or more runs of
-// ``go test -bench'', or another tool which uses the same format.
+// “go test -bench”, or another tool which uses the same format.
//
// Benchsave will upload the input files to the specified server and
// print a URL where they can be viewed.
diff --git a/cmd/benchstat/main.go b/cmd/benchstat/main.go
index b882c06..84f3849 100644
--- a/cmd/benchstat/main.go
+++ b/cmd/benchstat/main.go
@@ -9,7 +9,7 @@
// benchstat [-delta-test name] [-geomean] [-html] [-sort order] old.txt [new.txt] [more.txt ...]
//
// Each input file should contain the concatenated output of a number
-// of runs of ``go test -bench.'' For each different benchmark listed in an input file,
+// of runs of “go test -bench.” For each different benchmark listed in an input file,
// benchstat computes the mean, minimum, and maximum run time,
// after removing outliers using the interquartile range rule.
//
@@ -41,9 +41,9 @@
// none (input order), delta (percent improvement), or name (benchmark name).
// A leading “-” prefix, as in “-delta”, reverses the order.
//
-// Example
+// # Example
//
-// Suppose we collect benchmark results from running ``go test -bench=Encode''
+// Suppose we collect benchmark results from running “go test -bench=Encode”
// five times before and after a particular change.
//
// The file old.txt contains:
@@ -91,7 +91,6 @@
//
// Note that the JSONEncode result is reported as
// statistically insignificant instead of a -0.93% delta.
-//
package main
import (
diff --git a/storage/benchfmt/benchfmt.go b/storage/benchfmt/benchfmt.go
index 33eb3fa..2ea4288 100644
--- a/storage/benchfmt/benchfmt.go
+++ b/storage/benchfmt/benchfmt.go
@@ -28,13 +28,13 @@
// Reader reads benchmark results from an io.Reader.
// Use Next to advance through the results.
//
-// br := benchfmt.NewReader(r)
-// for br.Next() {
-// res := br.Result()
-// ...
-// }
-// err = br.Err() // get any error encountered during iteration
-// ...
+// br := benchfmt.NewReader(r)
+// for br.Next() {
+// res := br.Result()
+// ...
+// }
+// err = br.Err() // get any error encountered during iteration
+// ...
type Reader struct {
s *bufio.Scanner
labels Labels
diff --git a/storage/client.go b/storage/client.go
index 5519387..eee6439 100644
--- a/storage/client.go
+++ b/storage/client.go
@@ -69,15 +69,15 @@
// A Query allows iteration over the results of a search query.
// Use Next to advance through the results, making sure to call Close when done:
//
-// q := client.Query("key:value")
-// defer q.Close()
-// for q.Next() {
-// res := q.Result()
-// ...
-// }
-// if err = q.Err(); err != nil {
-// // handle error encountered during query
-// }
+// q := client.Query("key:value")
+// defer q.Close()
+// for q.Next() {
+// res := q.Result()
+// ...
+// }
+// if err = q.Err(); err != nil {
+// // handle error encountered during query
+// }
type Query struct {
br *benchfmt.Reader
body io.ReadCloser
@@ -160,15 +160,15 @@
// UploadList is the result of ListUploads.
// Use Next to advance through the rows, making sure to call Close when done:
//
-// q := db.ListUploads("key:value")
-// defer q.Close()
-// for q.Next() {
-// id, count := q.Row()
-// labels := q.LabelValues()
-// ...
-// }
-// err = q.Err() // get any error encountered during iteration
-// ...
+// q := db.ListUploads("key:value")
+// defer q.Close()
+// for q.Next() {
+// id, count := q.Row()
+// labels := q.LabelValues()
+// ...
+// }
+// err = q.Err() // get any error encountered during iteration
+// ...
type UploadList struct {
body io.Closer
dec *json.Decoder
@@ -267,16 +267,16 @@
// An Upload is an in-progress upload.
// Use CreateFile to upload one or more files, then call Commit or Abort.
//
-// u := client.NewUpload()
-// w, err := u.CreateFile()
-// if err != nil {
-// u.Abort()
-// return err
-// }
-// fmt.Fprintf(w, "BenchmarkResult 1 1 ns/op\n")
-// if err := u.Commit(); err != nil {
-// return err
-// }
+// u := client.NewUpload()
+// w, err := u.CreateFile()
+// if err != nil {
+// u.Abort()
+// return err
+// }
+// fmt.Fprintf(w, "BenchmarkResult 1 1 ns/op\n")
+// if err := u.Commit(); err != nil {
+// return err
+// }
type Upload struct {
pw io.WriteCloser
mpw *multipart.Writer
diff --git a/storage/cmd/reindex/reindex.go b/storage/cmd/reindex/reindex.go
index 2193745..7ab7cbe 100644
--- a/storage/cmd/reindex/reindex.go
+++ b/storage/cmd/reindex/reindex.go
@@ -10,6 +10,7 @@
//
// Reindex reindexes all the uploads with IDs starting with the given prefixes.
+//go:build cloud
// +build cloud
package main
diff --git a/storage/db/db.go b/storage/db/db.go
index d5674eb..1d92d24 100644
--- a/storage/db/db.go
+++ b/storage/db/db.go
@@ -437,14 +437,14 @@
// Query is the result of a query.
// Use Next to advance through the rows, making sure to call Close when done:
//
-// q := db.Query("key:value")
-// defer q.Close()
-// for q.Next() {
-// res := q.Result()
-// ...
-// }
-// err = q.Err() // get any error encountered during iteration
-// ...
+// q := db.Query("key:value")
+// defer q.Close()
+// for q.Next() {
+// res := q.Result()
+// ...
+// }
+// err = q.Err() // get any error encountered during iteration
+// ...
type Query struct {
rows *sql.Rows
// for Debug
@@ -544,14 +544,14 @@
// UploadList is the result of ListUploads.
// Use Next to advance through the rows, making sure to call Close when done:
//
-// q := db.ListUploads("key:value")
-// defer q.Close()
-// for q.Next() {
-// info := q.Info()
-// ...
-// }
-// err = q.Err() // get any error encountered during iteration
-// ...
+// q := db.ListUploads("key:value")
+// defer q.Close()
+// for q.Next() {
+// info := q.Info()
+// ...
+// }
+// err = q.Err() // get any error encountered during iteration
+// ...
type UploadList struct {
rows *sql.Rows
extraLabels []string
diff --git a/storage/localperfdata/app.go b/storage/localperfdata/app.go
index bcd590d..691274b 100644
--- a/storage/localperfdata/app.go
+++ b/storage/localperfdata/app.go
@@ -9,7 +9,7 @@
//
// Usage:
//
-// localperfdata [-addr address] [-view_url_base url] [-base_dir ../appengine] [-dsn file.db]
+// localperfdata [-addr address] [-view_url_base url] [-base_dir ../appengine] [-dsn file.db]
package main
import (