Start a new Go project

Melody only needs a few simple commands to deliver a lot of power. To get started, please run melody init to create a Melody.toml file inside of your project directory, and then melody update to download and lock your dependencies. All required packages will be installed into the project’s vendor subdirectory.

melody install

If you’re running this command for the first time, Melody will resolve the dependency graph via melodyRepo and install the latest possible versions of each repository into the vendor subdirectory. It will also save the current state in the Melody.lock file.

Locking dependency versions in Melody.lock ensures that subsequent executions of the install command will recreate the vendor subdirectory with exactly the same versions of each dependency. Whenever you try to recreate a project build, you should start with this command to return the project to the locked state.

If you would like to update a particular dependency in the future, you can run:

melody update github.com/gin-gonic/gin

This command will try to make minimal changes to your lockfile while updating that particular dependency. But if you’re feeling adventurous and would like to update everything, run:

melody update

Also, you can peek at available updates without making any changes:

melody outdated

That’s it! Subsequent building and testing can be done via standard Go toolchain.