From a553f3eeee489d762a740f2416cc7906a2bdb6db Mon Sep 17 00:00:00 2001 From: Jeff Carr Date: Thu, 16 Oct 2025 05:42:51 -0500 Subject: check for goimports. autogenpb needs it --- main.go | 15 +++++++++++++++ 1 file changed, 15 insertions(+) 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) } -- cgit v1.2.3