On Tue, Dec 21, 2021 at 10:14 AM Mitar <mmi...@gmail.com> wrote: > > I am trying to make a CLI tool which would have sub-commands and some > of them would call into other existing CLI tools (written in Go). The > issue is that those other commands sometimes have CLI parsing code as > part of the main package (e.g., example.com/cmd/example) and the hook > to call into the main (passing a list of arguments) is also in the > main package. I do not want to use a subprocess because that would > mean that a user would have to install those other CLI tools, too. > > I understand why it is not reasonable to import main packages into > non-main packages, but my understanding is that importing a main > package into another main package should work, at least according to > [1]. But I cannot get it to work. > > So is [1] wrong or has that changed since then? > > Is there some other way to get `go install`ed tool to define a > dependency on another `go install`ed tool so that both are installed > as CLI tools? > > > Mitar > > [1] https://groups.google.com/g/golang-nuts/c/frh9zQPEjUk/m/9tnVPAegDgAJ
Support for importing a main package was dropped from the go tool as part of https://golang.org/issue/4210. Ian -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/golang-nuts/CAOyqgcXR97WuKtidHdUqkCCdu4kGOnEEuhz14doVTH96%3D2qLjw%40mail.gmail.com.