Skip to content

Commit

Permalink
fix: import path
Browse files Browse the repository at this point in the history
  • Loading branch information
sysulq committed Oct 28, 2024
1 parent 07ef6a3 commit 660ecc7
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions cmd/kod/internal/generate_generator.go
Original file line number Diff line number Diff line change
Expand Up @@ -701,7 +701,6 @@ func (g *generator) generateRegisteredComponents(p printFn) {
name := comp.intfName()
myName := comp.fullIntfName()

g.interceptor()
localStubFn := fmt.Sprintf(`func(ctx context.Context, info *kod.LocalStubFnInfo) any {
return %s_local_stub{
impl: info.Impl.(%s),
Expand Down Expand Up @@ -765,15 +764,16 @@ func (g *generator) generateLocalStubs(p printFn) {
p(``)
p(``)
p(`// Local stub implementations.`)
p(``)
g.tset.importPackage("context", "context")

var b strings.Builder
for _, comp := range g.components {
if comp.isMain {
continue
}

g.tset.importPackage("context", "context")
g.interceptor()

stub := notExported(comp.intfName()) + "_local_stub"
p(`// %s is a local stub implementation of [%s].`, stub, g.tset.genTypeString(comp.intf))
p(`type %s struct{`, stub)
Expand Down

0 comments on commit 660ecc7

Please sign in to comment.