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