Skip to content

Commit 10050f0

Browse files
authored
fix(internal/gensnippets): run goimports (#3931)
Updates #3916.
1 parent 1204de8 commit 10050f0

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

internal/gensnippets/main.go

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ import (
3535

3636
"cloud.google.com/go/internal/godocfx/pkgload"
3737
"cloud.google.com/go/third_party/go/doc"
38+
"golang.org/x/sys/execabs"
3839
)
3940

4041
func main() {
@@ -77,6 +78,14 @@ func main() {
7778
}
7879
}
7980
}
81+
82+
if len(dirs) > 0 {
83+
cmd := execabs.Command("goimports", "-w", ".")
84+
cmd.Dir = *outDir
85+
if err := cmd.Run(); err != nil {
86+
log.Fatalf("failed to run goimports: %v", err)
87+
}
88+
}
8089
}
8190

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

0 commit comments

Comments
 (0)