fix(internal/gensnippets): run goimports
Updates
@@ -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() {
@@ -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 {
