Skip to content

Commit

Permalink
Do not generate import statements for the generated package
Browse files Browse the repository at this point in the history
This fixes an import cycle loop when importing local files.
  • Loading branch information
Spencer Nelson committed Dec 3, 2019
1 parent a0b0ca6 commit 7d80300
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions protoc-gen-twirp/generator.go
Original file line number Diff line number Diff line change
Expand Up @@ -329,8 +329,9 @@ func (t *twirp) generateImports(file *descriptor.FileDescriptorProto) {
}
importPath = t.importPrefix + importPath
pkg := t.goPackageName(def.File)
deps[pkg] = strconv.Quote(importPath)

if pkg != t.genPkgName {
deps[pkg] = strconv.Quote(importPath)
}
}
}
}
Expand Down

0 comments on commit 7d80300

Please sign in to comment.