DEV Community

abdfn
abdfn

Posted on

3 2

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?

AWS Security LIVE!

Tune in for AWS Security LIVE!

Join AWS Security LIVE! for expert insights and actionable tips to protect your organization and keep security teams prepared.

Learn More

πŸ‘‹ Kindness is contagious

Immerse yourself in a wealth of knowledge with this piece, supported by the inclusive DEV Communityβ€”every developer, no matter where they are in their journey, is invited to contribute to our collective wisdom.

A simple β€œthank you” goes a long wayβ€”express your gratitude below in the comments!

Gathering insights enriches our journey on DEV and fortifies our community ties. Did you find this article valuable? Taking a moment to thank the author can have a significant impact.

Okay