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