nextmv Docs

Building And Testing

Building And Testing

Hop requires at least Go 1.13.

You should have the following environment variables set in your environment (~/.bashrc, ~/.zshrc or a similar configuration file). These settings allow Go to fetch Nextmv code directly from GitHub and ensures any Go tooling is available on your system path.

export GOPRIVATE=github.com/nextmv-io/*
export PATH=$(go env GOPATH)/bin:$PATH

Go uses git to fetch source code from remote repositories. Because Nextmv products are source distributions in private repositories that require two factor authentication you must change your git config (usually ~/.gitconfig) to rewrite HTTPS URLs to use SSH.

[url "git@github.com:"]
insteadOf = https://github.com/

If you are using the source distribution, you can build and test from the hop/ directory with the go command.

go build ./...
go test ./...
ok github.com/nextmv-io/code/hop 0.160s
ok github.com/nextmv-io/code/hop/model 0.176s
ok github.com/nextmv-io/code/hop/run 0.273s
ok github.com/nextmv-io/code/hop/run/cli 0.128s
ok github.com/nextmv-io/code/hop/run/http 0.183s
ok github.com/nextmv-io/code/hop/run/lambda 0.244s
ok github.com/nextmv-io/code/hop/solve 0.235s
ok github.com/nextmv-io/code/hop/solve/diagram 0.092s
ok github.com/nextmv-io/code/hop/solve/diagram/reduce 0.233s
ok github.com/nextmv-io/code/hop/solve/diagram/restrict 0.224s
ok github.com/nextmv-io/code/hop/solve/queue 0.256s
ok github.com/nextmv-io/code/hop/solve/search 0.259s
ok github.com/nextmv-io/code/hop/solve/stats 0.181s

Hop Releases

Like other Go modules, Hop uses semantic versioning. We tag releases from the stable branch and add updates to the change log. Once we tag a new release, you can use go get to require the new version of Hop in your own modules.

In this example replace <VERSION> with the semantic version you want to depend on (e.g. v0.2.3). Upgrading or downgrading your version of Hop works the same way.

go mod init
go get github.com/nextmv-io/code/hop@<VERSION>