DEV Community

abdfn
abdfn

Posted on

Gomo - 📐 Simple Golang multi modules tool.


Gomo

GitHub logo abdfnx / gomo

📐 Simple Golang multi modules tool. inspired from turborepo.

Gomo is a Simple Golang multi modules tool. inspired from turborepo

Installation ⬇

Using script

  • Shell
curl -sL https://bit.ly/gomo-cli | bash
Enter fullscreen mode Exit fullscreen mode
  • PowerShell
iwr -useb https://bit.ly/gomo-win | iex
Enter fullscreen mode Exit fullscreen mode

then restart your powershell

Homebrew

brew install abdfnx/tap/gomo
Enter fullscreen mode Exit fullscreen mode

Usage

  • Creates a new gomo.json file in the current folder
gomo init
Enter fullscreen mode Exit fullscreen mode
  • Initialize a new module
gomo init --mod github.com/x/x2 --path dir
Enter fullscreen mode Exit fullscreen mode
  • Download go packages through all your modules
gomo
Enter fullscreen mode Exit fullscreen mode
  • Get a go package and add it through all modules
gomo get github.com/gorilla/mux
Enter fullscreen mode Exit fullscreen mode
  • Delete a go package through all modules
gomo delete github.com/example/example1
Enter fullscreen mode Exit fullscreen mode
  • Update all packages
gomo update
Enter fullscreen mode Exit fullscreen mode
  • Add any missing packages necessary to build all your modules
gomo tidy
Enter fullscreen mode Exit fullscreen mode

Gomo config file

{
  "cmds": {
    "download": "go mod download",
    "update": "go get -u"
  },
  "modules": [
    ".",
    "test",
    "test/web"
  ]
}
Enter fullscreen mode Exit fullscreen mode

thank you for your time and don't forgot to star the repo if you like it

Top comments (3)

Collapse
 
dogers profile image
Dogers

So it's just a wrapper round go mod ? What's the point?

Collapse
 
abdfnx profile image
abdfn • Edited

so, let's say you have more than a module in one repo, and you want to install all packages in these modules, instead of run go mod in every single module. just run gomo.

it's like when you have a javascript monorepo with nx or turborepo 👍.

Collapse
 
dogers profile image
Dogers

Ahh okay I getcha - I don't do JS :D
Although I think having multiple modules in one repo goes against the Go way..? Maybe if they're all related I guess?