Debian Codegraph @

libgo/misc/cgo/testshared/testdata/depBase/dep.go

raw
1 // Copyright 2016 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 depBase
6
7 import (
8 "os"
9 "reflect"
10 )
11
12 var SlicePtr interface{} = &[]int{}
13
14 var V int = 1
15
16 var HasMask []string = []string{"hi"}
17
18 type HasProg struct {
19 array [1024]*byte
20 }
21
22 type Dep struct {
23 X int
24 }
25
26 func (d *Dep) Method() int {
27 // This code below causes various go.itab.* symbols to be generated in
28 // the shared library. Similar code in ../exe/exe.go results in
29 // exercising https://golang.org/issues/17594
30 reflect.TypeOf(os.Stdout).Elem()
31 return 10
32 }
33
34 func F() int {
35 defer func() {}()
36 return V
37 }