Skip to content

Commit

Permalink
Strip vendor prefix from import paths
Browse files Browse the repository at this point in the history
  • Loading branch information
chriso committed Sep 25, 2023
1 parent cbf70c6 commit 3f2e3c1
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 2 deletions.
1 change: 1 addition & 0 deletions compiler/compile.go
Original file line number Diff line number Diff line change
Expand Up @@ -308,6 +308,7 @@ func addImports(p *packages.Package, gen *ast.File) *ast.File {
if pkg == "" {
break
}
pkg = strings.TrimPrefix(pkg, "vendor/")

if existing, ok := imports[ident.Name]; ok && existing != pkg {
fmt.Println("existing:", ident.Name, existing)
Expand Down
2 changes: 1 addition & 1 deletion compiler/testdata/http/main_durable.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion compiler/vendor.go
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,6 @@ func scanDir(dst, src string, ops chan<- copyOperation) error {
}
for _, entry := range entries {
name := entry.Name()
fmt.Println(dst, src, name)
if entry.IsDir() {
dstChild := filepath.Join(dst, name)
srcChild := filepath.Join(src, name)
Expand Down

0 comments on commit 3f2e3c1

Please sign in to comment.