Skip to content

Commit 824f64d

Browse files
committed
fix: update CyclicDeps test to use interfaces
Signed-off-by: Valery Piashchynski <[email protected]>
1 parent 7778de0 commit 824f64d

File tree

4 files changed

+27
-4
lines changed

4 files changed

+27
-4
lines changed

tests/stress/CyclicDeps/plugin1.go

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,11 @@ import (
77
type Plugin1 struct {
88
}
99

10-
func (p1 *Plugin1) Init(p2 *Plugin2) error {
10+
type Stringer2 interface {
11+
String2() string
12+
}
13+
14+
func (p1 *Plugin1) Init(p2 Stringer2) error {
1115
return nil
1216
}
1317

@@ -19,3 +23,7 @@ func (p1 *Plugin1) Serve() chan error {
1923
func (p1 *Plugin1) Stop(context.Context) error {
2024
return nil
2125
}
26+
27+
func (p1 *Plugin1) String1() string {
28+
return "Plugin1"
29+
}

tests/stress/CyclicDeps/plugin2.go

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,11 @@ import (
77
type Plugin2 struct {
88
}
99

10-
func (p2 *Plugin2) Init(p3 *Plugin3) error {
10+
type Stringer3 interface {
11+
String3() string
12+
}
13+
14+
func (p2 *Plugin2) Init(p3 Stringer3) error {
1115
return nil
1216
}
1317

@@ -19,3 +23,7 @@ func (p2 *Plugin2) Serve() chan error {
1923
func (p2 *Plugin2) Stop(context.Context) error {
2024
return nil
2125
}
26+
27+
func (p2 *Plugin2) String2() string {
28+
return "Plugin2"
29+
}

tests/stress/CyclicDeps/plugin3.go

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,11 @@ import (
77
type Plugin3 struct {
88
}
99

10-
func (p3 *Plugin3) Init(p1 *Plugin1) error {
10+
type Stringer1 interface {
11+
String1() string
12+
}
13+
14+
func (p3 *Plugin3) Init(p1 Stringer1) error {
1115
return nil
1216
}
1317

@@ -19,3 +23,7 @@ func (p3 *Plugin3) Serve() chan error {
1923
func (p3 *Plugin3) Stop(context.Context) error {
2024
return nil
2125
}
26+
27+
func (p3 *Plugin3) String3() string {
28+
return "Plugin3"
29+
}

tests/stress/CyclicDepsCollects/p1/plugin1.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ func (p1 *Plugin1) Stop(context.Context) error {
2929
func (p1 *Plugin1) Collects() []*dep.In {
3030
return []*dep.In{
3131
dep.Fits(func(any) {
32-
3332
}, (*Bar)(nil)),
3433
}
3534
}

0 commit comments

Comments
 (0)