1
2
3
4
5 package main
6
7 import (
8 "sort"
9 "strings"
10
11 "issue20014.dir/a"
12 )
13
14 func main() {
15 samePackage()
16 crossPackage()
17
18
19 var fields []string
20 for _, line := range strings.Split(fieldTrackInfo, "\n") {
21 if line != "" {
22 fields = append(fields, strings.Split(line, "\t")[0])
23 }
24 }
25 sort.Strings(fields)
26 for _, field := range fields {
27 println(field)
28 }
29 }
30
31 type T struct {
32 X int `go:"track"`
33 Y int `go:"track"`
34 Z int
35 }
36
37 func (t *T) GetX() int {
38 return t.X
39 }
40 func (t *T) GetY() int {
41 return t.Y
42 }
43 func (t *T) GetZ() int {
44 return t.Z
45 }
46
47 func samePackage() {
48 var t T
49 println(t.GetX())
50 println(t.GetZ())
51 }
52
53 func crossPackage() {
54 var t a.T
55 println(t.GetX())
56 println(t.GetZ())
57 }
58
59
60 var fieldTrackInfo string
61
View as plain text