File: basic.txt

package info (click to toggle)
golang-golang-x-tools 1%3A0.25.0%2Bds-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 22,724 kB
  • sloc: javascript: 2,027; asm: 1,645; sh: 166; yacc: 155; makefile: 49; ansic: 8
file content (73 lines) | stat: -rw-r--r-- 1,882 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
Basic test of implementation query.

-- go.mod --
module example.com
go 1.12

-- implementation/implementation.go --
package implementation

import "example.com/other"

type ImpP struct{} //@loc(ImpP, "ImpP"),implementation("ImpP", Laugher, OtherLaugher)

func (*ImpP) Laugh() { //@loc(LaughP, "Laugh"),implementation("Laugh", Laugh, OtherLaugh)
}

type ImpS struct{} //@loc(ImpS, "ImpS"),implementation("ImpS", Laugher, OtherLaugher)

func (ImpS) Laugh() { //@loc(LaughS, "Laugh"),implementation("Laugh", Laugh, OtherLaugh)
}

type Laugher interface { //@loc(Laugher, "Laugher"),implementation("Laugher", ImpP, OtherImpP, ImpS, OtherImpS, embedsImpP)
	Laugh() //@loc(Laugh, "Laugh"),implementation("Laugh", LaughP, OtherLaughP, LaughS, OtherLaughS)
}

type Foo struct { //@implementation("Foo", Joker)
	other.Foo
}

type Joker interface { //@loc(Joker, "Joker")
	Joke() //@loc(Joke, "Joke"),implementation("Joke", ImpJoker)
}

type cryer int //@implementation("cryer", Cryer)

func (cryer) Cry(other.CryType) {} //@loc(CryImpl, "Cry"),implementation("Cry", Cry)

type Empty interface{} //@implementation("Empty")

var _ interface{ Joke() } //@implementation("Joke", ImpJoker)

type embedsImpP struct { //@loc(embedsImpP, "embedsImpP")
	ImpP //@implementation("ImpP", Laugher, OtherLaugher)
}

-- other/other.go --
package other

type ImpP struct{} //@loc(OtherImpP, "ImpP")

func (*ImpP) Laugh() { //@loc(OtherLaughP, "Laugh")
}

type ImpS struct{} //@loc(OtherImpS, "ImpS")

func (ImpS) Laugh() { //@loc(OtherLaughS, "Laugh")
}

type ImpI interface { //@loc(OtherLaugher, "ImpI")
	Laugh() //@loc(OtherLaugh, "Laugh")
}

type Foo struct { //@implementation("Foo", Joker)
}

func (Foo) Joke() { //@loc(ImpJoker, "Joke"),implementation("Joke", Joke)
}

type CryType int

type Cryer interface { //@loc(Cryer, "Cryer")
	Cry(CryType) //@loc(Cry, "Cry"),implementation("Cry", CryImpl)
}