Debian Codegraph @

test/c/c.go

raw symbols SCIP
1 package c
2
3 import "time"
4
5 // func type comment
6 type Handler func() string // after
7
8 type Raw []byte
9
10 type Example1 struct {
11 Name string
12 }
13
14 // Example:
15 //
16 // Some
17 // code
18 // sample
19 type Example2 struct {
20 Title string
21 Json Raw
22 Bytes []byte // should be union
23 }
24
25 func (e *Example1) DemoEx1() string {
26 return ""
27 }
28
29 func (e *Example2) DemoEx2() time.Time {
30 return time.Time{}
31 }
32
33 // Pointer as argument vs return type
34 func (e *Example2) DemoEx3(arg *Example1) (*Example1, error) {
35 return nil, nil
36 }
37
38 // ommited types
39 func (e *Example2) DemoEx4(n1, n2, n3 string) {
40 }
41
42 // ommited names
43 func (e *Example2) DemoEx5(string, int) {
44 }
45
46 // named return values
47 func (e *Example2) DemoEx6() (b int, c string) {
48 return
49 }
50
51 // shortened return values
52 func (e *Example2) DemoEx7() (b, c string) {
53 return
54 }
55
56 // named and shortened return values
57 func (e *Example2) DemoEx8() (a int, b, c string) {
58 return
59 }