summaryrefslogtreecommitdiff
path: root/main.go
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2025-10-16 05:42:51 -0500
committerJeff Carr <[email protected]>2025-10-16 05:42:51 -0500
commita553f3eeee489d762a740f2416cc7906a2bdb6db (patch)
treefb0f552ac13aa1ca54cd59f02f34f6c426e510a5 /main.go
parent30e8de23f6ae78136e93add8e1464da5e45b020e (diff)
check for goimports. autogenpb needs it
Diffstat (limited to 'main.go')
-rw-r--r--main.go15
1 files changed, 15 insertions, 0 deletions
diff --git a/main.go b/main.go
index 2da2278..993d88a 100644
--- a/main.go
+++ b/main.go
@@ -62,6 +62,21 @@ func main() {
os.Exit(-1)
}
+ if path, err := fhelp.CheckCmd("goimports"); err != nil {
+ log.Info("this tool requires goimports")
+ if path != "" {
+ log.Info("path might be:", path)
+ }
+ log.Info("this tool requires goimports")
+ cmd := []string{"go", "install", "-v", "-x", "golang.org/x/tools/cmd/goimports@latest"}
+ log.Info("Need to run:", cmd)
+ if fhelp.QuestionUser("build goimports?") {
+ shell.RunRealtime(cmd)
+ } else {
+ os.Exit(-1)
+ }
+ }
+
doProto(argv.Proto)
}