mirror of
https://github.com/golang/go
synced 2024-11-21 21:34:40 -07:00
go/doc: test case for corner case (override of predecl. type)
R=rsc CC=golang-dev https://golang.org/cl/5575055
This commit is contained in:
parent
6d68be46dd
commit
57af5429e6
9
src/pkg/go/doc/testdata/b.0.golden
vendored
9
src/pkg/go/doc/testdata/b.0.golden
vendored
@ -24,6 +24,12 @@ FUNCTIONS
|
||||
//
|
||||
func F(x int) int
|
||||
|
||||
// Always under the package functions list.
|
||||
func NotAFactory() int
|
||||
|
||||
// Associated with uint type if AllDecls is set.
|
||||
func UintFactory() uint
|
||||
|
||||
|
||||
TYPES
|
||||
//
|
||||
@ -32,3 +38,6 @@ TYPES
|
||||
//
|
||||
var V T // v
|
||||
|
||||
//
|
||||
func (x *T) M()
|
||||
|
||||
|
15
src/pkg/go/doc/testdata/b.1.golden
vendored
15
src/pkg/go/doc/testdata/b.1.golden
vendored
@ -24,6 +24,9 @@ FUNCTIONS
|
||||
//
|
||||
func F(x int) int
|
||||
|
||||
// Always under the package functions list.
|
||||
func NotAFactory() int
|
||||
|
||||
|
||||
TYPES
|
||||
//
|
||||
@ -32,3 +35,15 @@ TYPES
|
||||
//
|
||||
var V T // v
|
||||
|
||||
//
|
||||
func (x *T) M()
|
||||
|
||||
// Should only appear if AllDecls is set.
|
||||
type uint struct{}
|
||||
|
||||
// Associated with uint type if AllDecls is set.
|
||||
func UintFactory() uint
|
||||
|
||||
// Associated with uint type if AllDecls is set.
|
||||
func uintFactory() uint
|
||||
|
||||
|
17
src/pkg/go/doc/testdata/b.go
vendored
17
src/pkg/go/doc/testdata/b.go
vendored
@ -6,8 +6,25 @@ package b
|
||||
|
||||
import "a"
|
||||
|
||||
// Basic declarations
|
||||
|
||||
const Pi = 3.14 // Pi
|
||||
var MaxInt int // MaxInt
|
||||
type T struct{} // T
|
||||
var V T // v
|
||||
func F(x int) int {} // F
|
||||
func (x *T) M() {} // M
|
||||
|
||||
// Corner cases: association with (presumed) predeclared types
|
||||
|
||||
// Always under the package functions list.
|
||||
func NotAFactory() int {}
|
||||
|
||||
// Associated with uint type if AllDecls is set.
|
||||
func UintFactory() uint {}
|
||||
|
||||
// Associated with uint type if AllDecls is set.
|
||||
func uintFactory() uint {}
|
||||
|
||||
// Should only appear if AllDecls is set.
|
||||
type uint struct{} // overrides a predeclared type uint
|
||||
|
Loading…
Reference in New Issue
Block a user