Adding call to `gofmt` once a profile is generated
@@ -38,6 +38,7 @@ import (
"io/ioutil"
"log"
"os"
+ "os/exec"
"path"
"path/filepath"
"strings"
@@ -257,9 +258,14 @@ func main() {
generated++
}
}
-
outputLog.Print(generated, " packages generated.")
+ if err := exec.Command("gofmt", "-w", outputLocation).Run(); err == nil {
+ outputLog.Print("Success formatting profile.")
+ } else {
+ errLog.Print("Trouble formatting profile: ", err)
+ }
+
}
func init() {
