go/doc, godoc: regard lone examples as "whole file" examples

Fixes #2930.

R=r, gri, rsc
CC=golang-dev
https://golang.org/cl/5657048
This commit is contained in:
Andrew Gerrand 2012-02-14 17:19:59 +11:00
parent 1c987a321f
commit e11632ee00
4 changed files with 39 additions and 9 deletions

View file

@ -64,6 +64,9 @@
// func ExampleT_suffix() { ... }
// func ExampleT_M_suffix() { ... }
//
// The entire test file is presented as the example when it contains a single
// example function, at least one other function, type, variable, or constant
// declaration, and no test or benchmark functions.
package testing
import (