github.com/cockroachdb/tools@v0.0.0-20230222021103-a6d27438930d/internal/gcimporter/testdata/exports.go (about) 1 // Copyright 2011 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 // This file is used to generate an object file which 6 // serves as test file for gcimporter_test.go. 7 8 package exports 9 10 import ( 11 "go/ast" 12 ) 13 14 // Issue 3682: Correctly read dotted identifiers from export data. 15 const init1 = 0 16 17 func init() {} 18 19 const ( 20 C0 int = 0 21 C1 = 3.14159265 22 C2 = 2.718281828i 23 C3 = -123.456e-789 24 C4 = +123.456E+789 25 C5 = 1234i 26 C6 = "foo\n" 27 C7 = `bar\n` 28 ) 29 30 type ( 31 T1 int 32 T2 [10]int 33 T3 []int 34 T4 *int 35 T5 chan int 36 T6a chan<- int 37 T6b chan (<-chan int) 38 T6c chan<- (chan int) 39 T7 <-chan *ast.File 40 T8 struct{} 41 T9 struct { 42 a int 43 b, c float32 44 d []string `go:"tag"` 45 } 46 T10 struct { 47 T8 48 T9 49 _ *T10 50 } 51 T11 map[int]string 52 T12 interface{} 53 T13 interface { 54 m1() 55 m2(int) float32 56 } 57 T14 interface { 58 T12 59 T13 60 m3(x ...struct{}) []T9 61 } 62 T15 func() 63 T16 func(int) 64 T17 func(x int) 65 T18 func() float32 66 T19 func() (x float32) 67 T20 func(...interface{}) 68 T21 struct{ next *T21 } 69 T22 struct{ link *T23 } 70 T23 struct{ link *T22 } 71 T24 *T24 72 T25 *T26 73 T26 *T27 74 T27 *T25 75 T28 func(T28) T28 76 ) 77 78 var ( 79 V0 int 80 V1 = -991.0 81 ) 82 83 func F1() {} 84 func F2(x int) {} 85 func F3() int { return 0 } 86 func F4() float32 { return 0 } 87 func F5(a, b, c int, u, v, w struct{ x, y T1 }, more ...interface{}) (p, q, r chan<- T10) 88 89 func (p *T1) M1()