Skip to content

Commit

Permalink
fix(internal/gensnippets): run goimports (#3931)
Browse files Browse the repository at this point in the history
Updates #3916.
  • Loading branch information
tbpg authored Apr 14, 2021
1 parent 1204de8 commit 10050f0
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions internal/gensnippets/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ import (

"cloud.google.com/go/internal/godocfx/pkgload"
"cloud.google.com/go/third_party/go/doc"
"golang.org/x/sys/execabs"
)

func main() {
Expand Down Expand Up @@ -77,6 +78,14 @@ func main() {
}
}
}

if len(dirs) > 0 {
cmd := execabs.Command("goimports", "-w", ".")
cmd.Dir = *outDir
if err := cmd.Run(); err != nil {
log.Fatalf("failed to run goimports: %v", err)
}
}
}

func processExamples(pkg *doc.Package, fset *token.FileSet, trimPrefix, outDir string) error {
Expand Down

0 comments on commit 10050f0

Please sign in to comment.