Go Viewer Test

Home|go_viewer_test/test_files/say_hello.go
1package main
2
3import (
4    "fmt"
5    "go/build"
6    subselImp "go_viewer_test/test_files/sel/subsel"
7)
8
9type CompisiteScopeType int
10
11const (
12    CompisiteScopeTop          CompisiteScopeType = 0
13    CompisiteScopeNon          CompisiteScopeType = 1
14    CompisiteScopeFuncDecl     CompisiteScopeType = 2
15    CompisiteScopeTypeDecl     CompisiteScopeType = 3
16    CompisiteScopeTypeRecv     CompisiteScopeType = 4
17    CompisiteScopeStructAssign CompisiteScopeType = 5
18    CompisiteScopeRangeStmt    CompisiteScopeType = 6
19
20    ScopePathSep     = ":"
21    ScopeDefineSep   = "."
22    ScopePackageName = "pkg"
23
24    ScopeBlockStmt = "BlockStmt"
25    ScopeRangeStmt = "RangeStmt"
26    ScopeElts      = "Elts"
27)
28
29var test string = "test"
30
31var ignoreVendor build.ImportMode
32
33type TestStructSubMethod struct {
34    methodTest  string
35    Build       *build.Context
36    FindPackage func(ctxt *build.ContextimportPathfromDir stringmode build.ImportMode) (*build.Packageerror)
37}
38
39func (ts TestStructSubMethodtestSelCopy() string {
40    stt := ts.methodTest
41    return stt
42}
43
44func (ts TestStructSubMethodbuild() *build.Context {
45    return &build.Default
46}
47
48type TestStructKey struct {
49    A       string
50    B       int
51    C       TestStructSub
52    TestASN string
53}
54
55type TestStructSub struct {
56    TestStructSubMethodMap    map[string]*TestStructSubMethod                                     // ast file map
57    TestStructSubMethodMapMap map[subselImp.TestStruct]map[string]map[string]*TestStructSubMethod // ast file map
58    TestStructSubMethodKeyMap map[*subselImp.TestStruct]*TestStructSubMethod                      // ast file map
59
60    EEEEEEEEEEE string
61    F           int
62
63    Sub      *TestStructSubSub
64    SubArray []TestStructSubSub
65}
66
67func (ts *TestStructSubSayGood(sts *subselImp.TestStructOther) (b *TestStructSubd *subselImp.TestStructOthere TestStructSubSub) {
68
69    var testStructSubMethodMapC []*subselImp.TestStructOther
70    for indexitem := range testStructSubMethodMapC {
71        fmt.Printf("%d, %s"indexitem.A)
72    }
73
74    var testStructSubMethodArray []*TestStructSubMethod
75    for indexitem := range testStructSubMethodArray {
76        fmt.Printf("%d, %s"indexitem.methodTest)
77    }
78
79    fmt.Printf("%d %s", (int)(CompisiteScopeTop), ScopeRangeStmt)
80    ts.Sub.SayGood("")
81    for _item := range ts.TestStructSubMethodMapMap {
82        fmt.Printf("%d"len(item))
83        for index1item1 := range item {
84            fmt.Printf("%s, %d"index1len(item1))
85
86            for index2item2 := range item1 {
87                fmt.Printf("%s, %s"index2item2.methodTest)
88            }
89        }
90    }
91    for indexitem := range ts.TestStructSubMethodMap {
92        fmt.Printf("%d, %s"indexitem.methodTest)
93    }
94    var testStructSubMethodMap map[string]*TestStructSubMethod
95    for indexitem := range testStructSubMethodMap {
96        fmt.Printf("%d, %s"indexitem.methodTest)
97    }
98    //testStructSubMethodMapB := &testStructSubMethodMap //make(map[subselImp.TestStructOther]*subselImp.TestStructOther)
99    //testStructSubMethodMapC := make(map[subselImp.TestStructOther]*subselImp.TestStructOther)
100    for indexitem := range testStructSubMethodMapC {
101        fmt.Printf("%d, %s"indexitem.A)
102    }
103
104    rtnSubsetOther := &subselImp.TestStructOther{}
105    rtnSubsetOtherStar := subselImp.TestStructOther{}
106    rtnSubsetOtherB := *rtnSubsetOther
107    rtnSubsetOtherG := &rtnSubsetOtherStar
108    rtnSubsetOtherH := rtnSubsetOther
109    rtnSubsetOtherH.SayGood2("")
110    rtnSubsetOtherB.SayGood("")
111    rtnSubsetOtherG.SayGood2("")
112    rtnSubsetOtherC := ""
113    rtnSubsetOtherD := 100
114    rtnSubsetOtherE := TestStructSub{}
115    rtnSubsetOtherF := &TestStructSub{}
116    fmt.Printf("%s %d"rtnSubsetOtherCrtnSubsetOtherD)
117    rtnSubsetOtherE.SayGood2("")
118    rtnSubsetOtherF.SayGood2("")
119
120    sts.SayGoodXXBB("")
121    d.SayGoodXXBB("")
122    b.TestStructSubBB("")
123
124    tst := ts.TestStructSub("")
125
126    fmt.Printf("hello good %s"ts.EEEEEEEEEEE[0:len(tst.EEEEEEEEEEE)-1])
127    subselImp := subselImp.SayGoodTestWhile("")
128    {
129        subselImp := subselImp.SayGoodTestStruct("")
130        subselImp.SayGood("")
131        fmt.Println(subselImp)
132        {
133            subselImp := subselImp.A
134            fmt.Printf("%s %s"subselImprtnSubsetOther.A)
135        }
136    }
137
138    return nilrtnSubsetOtherTestStructSubSub{}
139}
140
141func SayGood(sts *subselImp.TestStructOther) (b *TestStructSubd *subselImp.TestStructOthere TestStructSubSub) {
142    return &TestStructSub{}, &subselImp.TestStructOther{}, TestStructSubSub{}
143}
144
145func (ts *TestStructSubSayGood2(word string) *subselImp.TestStruct {
146    fmt.Printf("hello good %s %d"wordts.F)
147    return nil
148}
149
150func (ts *TestStructSubTestStructSub(word stringTestStructSub {
151    return TestStructSub{}
152}
153
154func (ts *TestStructSubTestStructSubBB(word stringTestStructSub {
155    return TestStructSub{}
156}
157
158func (ts *TestStructSubTestStructOther(word stringsubselImp.TestStructOther {
159    return subselImp.TestStructOther{}
160}
161
162func (ts *TestStructSubTestStructSubMethod(word stringTestStructSubMethod {
163    return TestStructSubMethod{}
164}
165
166func main() {
167    TestPackageSayGood("")
168    GetTestStructSubMethod().SayGood("")
169
170    var abc TestStructSub
171    test = abc.SubArray[0].SubSub.SubSubSub.SayGoodSubSubSub("").SubSubSubEEEE
172    testSubtestSubBtestSubC := SayGood(nil)
173    testSub.EEEEEEEEEEE = "tttt"
174    testSubB.B = 1
175    testSubC.SubEEEE = "ss"
176
177    testresult := abc.SayGood2("").SayGoodTest("").Sub.SayGood("")
178    fmt.Printf("test%s"testresult)
179
180    abc.Sub.SubSub.SubSubSub.SubSubSubEEEE = "SUBEEEEEE"
181
182    //TestASN := ""
183    ts := subselImp.TestStruct{
184        TestASN"",
185        B:       100,
186    }
187    ts.A = "bbbbb"
188    ts.SayGoodTest("hello")
189    /*
190        var abcd, aa TestStructSub
191        abcd.SayGood(test)
192        abcd.EEEEEEEEEEE = "tttt"
193        aa.Sub.SubF = 1
194
195        abc, efg := TestStructSub{}, TestStructSubSub{}
196        //var abc TestStructSub
197        abc.SayGood(test)
198        abc.F = 1
199
200        efg.SubEEEE = ""
201        efg.SayGood("")
202
203
204    */
205
206    //hello := "Hello" //test comment
207    //world := "World" // test comment
208    //words := []string{""} //[]string{hello /*testcomment*/, world /**test comment*/}
209
210    TestPackageSelector("input")
211    if test == "" {
212        test = ""
213        test2 = ""
214    }
215
216    //var abcIn TestStructSubSub
217
218    //abcIn.SubEEEE = "feeeeeee"
219
220    //SayHello(words)
221    //test = ""
222    //fmt.Print(test)
223}
224
225func TestPackageSelector(str string) {
226    //SayHello([]string{""})
227    test = "aaaa"
228
229    a := 0
230    a = 1
231    {
232        a := 2
233        if a == 2 {
234            a = 3
235        }
236    }
237    if a == 3 {
238        a = 1
239    }
240    test = str
241
242    ts := subselImp.TestStruct{
243        A"aaaa",
244        B100,
245    }
246
247    ts.B = 1000
248    ts.C.E = "ttt"
249    ts.SayGood("sel hello")
250
251    /*
252        {
253            ts := subsel.TestStruct{
254                A: str,
255                B: 100,
256            }
257            ts.B = 1001
258
259            {
260                ts := subsel.TestStruct{
261                    A: str,
262                    B: 100,
263                }
264                ts.B = 1001
265
266                {
267                    ts := subsel.TestStruct{
268                        A: str,
269                        B: 100,
270                    }
271                    ts.B = 1001
272                }
273            }
274        }
275    */
276}
277
278/*
279// SayHello says Hello
280func SayHello(words []string) {
281    fmt.Println(joinStrings(words))
282}
283
284// joinStrings joins strings
285func joinStrings(words []string) string {
286    return strings.Join(words, ", ")
287}
288*/
289
290type TestStructSubSubSubSub struct {
291    SubSubSubEEEE string
292    SubSubSubF    int
293}
294
295func (ts TestStructSubSubSubSubSayGoodSubSubSub(word string) *TestStructSubSubSubSub {
296    fmt.Printf("hello good %s %d"wordts.SubSubSubF)
297    return nil
298}
299
300type TestStructSubSubSub struct {
301    SubSubEEEE string
302    SubSubF    int
303
304    SubSubSub TestStructSubSubSubSub
305}
306
307type TestStructSubSub struct {
308    SubEEEE string
309    SubF    int
310
311    SubSub TestStructSubSubSub
312}
313
314func (ts TestStructSubSubSayGood(word string) *TestStructSubSub {
315    fmt.Printf("hello good %s %d"wordts.SubF)
316    return nil
317}
318
MembersX
TestStructSubSub.SayGood.word
TestStructKey.B
TestStructSub.SayGood.e
TestStructSub.TestStructSubBB.word
TestStructSubSubSubSub.SubSubSubF
TestStructSub.SayGood.testStructSubMethodArray
TestStructSub.SayGood.rtnSubsetOtherG
TestStructSub.SayGood.BlockStmt.BlockStmt.subselImp
TestStructSub.SayGood.RangeStmt_2603.item
TestStructSub.SayGood.RangeStmt_2916.index
CompisiteScopeType
ScopeElts
TestStructSub.SayGood.RangeStmt_1987.item
TestStructSub.SayGood.RangeStmt_2174.BlockStmt.RangeStmt_2258.item1
TestStructSub.SayGood.rtnSubsetOtherE
TestStructSub.TestStructSub.ts
TestStructSub.TestStructSubMethod.word
TestStructSubSubSub
TestStructSub.SayGood.sts
TestStructSub.SayGood.RangeStmt_2439.item
TestStructSub.TestStructSubMethod
TestStructSubSubSubSub
TestStructSubMethod.build.ts
TestStructSub.EEEEEEEEEEE
TestStructSub.SubArray
TestStructSubMethod.testSelCopy.ts
TestStructSub.F
TestStructSub.SayGood.RangeStmt_2174.BlockStmt.RangeStmt_2258.BlockStmt.RangeStmt_2340.index2
TestStructSubSubSub.SubSubF
CompisiteScopeTop
CompisiteScopeFuncDecl
ScopePathSep
TestStructSub.SayGood.b
TestPackageSelector.ts
CompisiteScopeTypeRecv
TestStructSub.TestStructSubMethodMap
TestStructSub.Sub
TestStructSub.TestStructSubMethodKeyMap
TestStructSub.TestStructSubMethod.ts
TestStructKey.C
TestStructSub.SayGood.BlockStmt.subselImp
TestStructSub.TestStructSubBB.ts
TestStructSub.SayGood.RangeStmt_2174.BlockStmt.RangeStmt_2258.BlockStmt.RangeStmt_2340.item2
TestStructSub.SayGood.rtnSubsetOtherB
CompisiteScopeStructAssign
TestStructSub.SayGood
TestStructSub.SayGood.RangeStmt_1987.index
TestStructSub.SayGood.RangeStmt_2439.index
TestStructSub.SayGood.RangeStmt_2603.index
TestStructSub.SayGood.RangeStmt_2174.BlockStmt.RangeStmt_2258.index1
TestStructSubMethod.methodTest
TestStructKey.A
TestStructSub.SayGood.RangeStmt_1840.item
TestStructSubMethod.testSelCopy.stt
fmt
TestStructSub.SayGood2.word
TestStructSubSub.SayGood
TestStructSubMethod.build
TestStructSub.SayGood.ts
TestStructSub.TestStructSubBB
TestStructSub.SayGood.rtnSubsetOtherF
TestStructSubSubSubSub.SubSubSubEEEE
main.testresult
TestStructSubSub.SayGood.ts
TestStructSub.SayGood.rtnSubsetOtherC
SayGood.b
main.testSubB
TestStructSub.SayGood.rtnSubsetOtherD
TestPackageSelector.a
TestStructSubSub
TestStructSubMethod.Build
TestStructSub.SayGood.rtnSubsetOther
TestStructSub.TestStructOther.word
main.ts
TestPackageSelector.str
TestPackageSelector.BlockStmt.a
TestStructSubSubSub.SubSubEEEE
subselImp
CompisiteScopeNon
ScopeRangeStmt
TestStructSubSubSubSub.SayGoodSubSubSub
TestStructSubSubSub.SubSubSub
ignoreVendor
TestStructSub.SayGood.d
TestStructSub.TestStructSub.word
build
TestStructKey
TestStructSub.SayGood.RangeStmt_2916.item
TestStructSub.TestStructOther
TestStructSubSub.SubEEEE
TestStructSub.SayGood.testStructSubMethodMapC
TestStructSub.SayGood.RangeStmt_2174.item
SayGood.e
TestStructSub.SayGood2.ts
TestStructSub
TestStructSub.SayGood.testStructSubMethodMap
TestStructSub.SayGood.rtnSubsetOtherStar
ScopeBlockStmt
TestStructSubSubSubSub.SayGoodSubSubSub.ts
TestStructSubSub.SubSub
CompisiteScopeTypeDecl
test
TestStructSub.TestStructSubMethodMapMap
SayGood.sts
TestStructSub.TestStructSub
TestStructSubMethod.FindPackage
SayGood.d
TestStructSubSub.SubF
TestStructKey.TestASN
TestStructSub.SayGood.tst
main.abc
main.testSub
main.testSubC
CompisiteScopeRangeStmt
ScopePackageName
TestStructSubMethod.testSelCopy
TestPackageSelector
TestStructSubSubSubSub.SayGoodSubSubSub.word
TestStructSub.SayGood2
TestStructSubMethod
TestStructSub.SayGood.RangeStmt_1840.index
TestStructSub.SayGood.rtnSubsetOtherH
TestStructSub.TestStructOther.ts
main
ScopeDefineSep
TestStructSub.SayGood.subselImp
SayGood
Members
X