Skip to content

Commit 660ecc7

Browse files
committed
fix: import path
1 parent 07ef6a3 commit 660ecc7

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

cmd/kod/internal/generate_generator.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -701,7 +701,6 @@ func (g *generator) generateRegisteredComponents(p printFn) {
701701
name := comp.intfName()
702702
myName := comp.fullIntfName()
703703

704-
g.interceptor()
705704
localStubFn := fmt.Sprintf(`func(ctx context.Context, info *kod.LocalStubFnInfo) any {
706705
return %s_local_stub{
707706
impl: info.Impl.(%s),
@@ -765,15 +764,16 @@ func (g *generator) generateLocalStubs(p printFn) {
765764
p(``)
766765
p(``)
767766
p(`// Local stub implementations.`)
768-
p(``)
769-
g.tset.importPackage("context", "context")
770767

771768
var b strings.Builder
772769
for _, comp := range g.components {
773770
if comp.isMain {
774771
continue
775772
}
776773

774+
g.tset.importPackage("context", "context")
775+
g.interceptor()
776+
777777
stub := notExported(comp.intfName()) + "_local_stub"
778778
p(`// %s is a local stub implementation of [%s].`, stub, g.tset.genTypeString(comp.intf))
779779
p(`type %s struct{`, stub)

0 commit comments

Comments
 (0)