/mass

Primary LanguageGo

Go Setup

Setup go in Docker

mkdir -p ~/bin
ln -s $PWD/goid.sh ~/bin/go

Your first program

see https://go.dev/doc/code

modulePath=<module-path> # Example: mby.fr/mass
mkdir -p src/$modulePath
cd src/$modulePath
go mod init $modulePath

Using cobra

go get github.com/spf13/cobra/cobra
go install github.com/spf13/cobra/cobra
ln -s $PWD/bin/cobra ~/bin/cobra
export GOPATH=$PWD
cd src/mby.fr/mass
cobra help
cobra add test

Testing

To launch all unit tests there is a conveniant script:

./unittest.sh

To launch unit test on an entire go module:

cd <my_go_module>
go test -cover ./...

Specifications

Project management

mass init workspace

Initialize a new workspace.

  • Create a new workspace directory
  • Create a hidden cache dire .mass
  • Create a settings file mass.yaml
  • Create the default minimal config for dev, stage and prod envs

mass init env

Initialize a new environment.

  • Create a new env directory

mass init project

Initialize a new project.

  • Create a new project directory

Project versionning

mass version

Display all versions in a project ?

mass version bump

Bump a version.