github.com/AndrienkoAleksandr/go@v0.0.19/src/go/doc/testdata/b.go (about) 1 // Copyright 2012 The Go Authors. All rights reserved. 2 // Use of this source code is governed by a BSD-style 3 // license that can be found in the LICENSE file. 4 5 package b 6 7 import "a" 8 9 // ---------------------------------------------------------------------------- 10 // Basic declarations 11 12 const Pi = 3.14 // Pi 13 var MaxInt int // MaxInt 14 type T struct{} // T 15 var V T // v 16 func F(x int) int {} // F 17 func (x *T) M() {} // M 18 19 // Corner cases: association with (presumed) predeclared types 20 21 // Always under the package functions list. 22 func NotAFactory() int {} 23 24 // Associated with uint type if AllDecls is set. 25 func UintFactory() uint {} 26 27 // Associated with uint type if AllDecls is set. 28 func uintFactory() uint {} 29 30 // Associated with comparable type if AllDecls is set. 31 func ComparableFactory() comparable {} 32 33 // Should only appear if AllDecls is set. 34 type uint struct{} // overrides a predeclared type uint 35 36 // Should only appear if AllDecls is set. 37 type comparable struct{} // overrides a predeclared type comparable 38 39 // ---------------------------------------------------------------------------- 40 // Exported declarations associated with non-exported types must always be shown. 41 42 type notExported int 43 44 const C notExported = 0 45 46 const ( 47 C1 notExported = iota 48 C2 49 c3 50 C4 51 C5 52 ) 53 54 var V notExported 55 var V1, V2, v3, V4, V5 notExported 56 57 var ( 58 U1, U2, u3, U4, U5 notExported 59 u6 notExported 60 U7 notExported = 7 61 ) 62 63 func F1() notExported {} 64 func f2() notExported {}