Skip to content

testing: use conventional comments for exported internal funcs & structs #36054

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions src/testing/benchmark.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,8 @@ var benchmarkLock sync.Mutex
// Used for every benchmark for measuring memory.
var memStats runtime.MemStats

// An internal type but exported because it is cross-package; part of the implementation
// of the "go test" command.
// InternalBenchmark is an internal type but exported because it is cross-package;
// it is part of the implementation of the "go test" command.
type InternalBenchmark struct {
Name string
F func(b *B)
Expand Down Expand Up @@ -342,7 +342,7 @@ func (b *B) ReportMetric(n float64, unit string) {
b.extra[unit] = n
}

// The results of a benchmark run.
// BenchmarkResult contains the results of a benchmark run.
type BenchmarkResult struct {
N int // The number of iterations.
T time.Duration // The total time taken.
Expand Down Expand Up @@ -488,8 +488,8 @@ type benchContext struct {
extLen int // Maximum extension length.
}

// An internal function but exported because it is cross-package; part of the implementation
// of the "go test" command.
// RunBenchmarks is an internal function but exported because it is cross-package;
// it is part of the implementation of the "go test" command.
func RunBenchmarks(matchString func(pat, str string) (bool, error), benchmarks []InternalBenchmark) {
runBenchmarks("", matchString, benchmarks)
}
Expand Down
4 changes: 2 additions & 2 deletions src/testing/example.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ type InternalExample struct {
Unordered bool
}

// An internal function but exported because it is cross-package; part of the implementation
// of the "go test" command.
// RunExamples is an internal function but exported because it is cross-package;
// it is part of the implementation of the "go test" command.
func RunExamples(matchString func(pat, str string) (bool, error), examples []InternalExample) (ok bool) {
_, ok = runExamples(matchString, examples)
return ok
Expand Down
8 changes: 4 additions & 4 deletions src/testing/testing.go
Original file line number Diff line number Diff line change
Expand Up @@ -863,8 +863,8 @@ func (t *T) Parallel() {
t.raceErrors += -race.Errors()
}

// An internal type but exported because it is cross-package; part of the implementation
// of the "go test" command.
// InternalTest is an internal type but exported because it is cross-package;
// it is part of the implementation of the "go test" command.
type InternalTest struct {
Name string
F func(*T)
Expand Down Expand Up @@ -1214,8 +1214,8 @@ func listTests(matchString func(pat, str string) (bool, error), tests []Internal
}
}

// An internal function but exported because it is cross-package; part of the implementation
// of the "go test" command.
// RunTests is an internal function but exported because it is cross-package;
// it is part of the implementation of the "go test" command.
func RunTests(matchString func(pat, str string) (bool, error), tests []InternalTest) (ok bool) {
ran, ok := runTests(matchString, tests)
if !ran && !haveExamples {
Expand Down