Switch to go modules for dependency management.

Added support for dependency management using go modules.
Note that Go version 1.11+ is required if using go modules for
dependency management.

Updated the gitlab CI yaml file to use go modules instead of copying
everything to GOPATH. Ran go mod download before running build script to
download all dependencies into cache.
This commit is contained in:
Pradyumna Kaushik 2019-10-02 00:21:21 +00:00
parent fca8887adf
commit 4fbbf91b00
5 changed files with 88 additions and 12 deletions

View file

@ -38,7 +38,16 @@ on the Mesos Agents**
Compatible with the following versions:
* Mesos 1.5.0
* Go 1.9.7
* Go 1.9.7 (if using go vendor for dependency management)
* Go 1.11+ (if using go modules for dependency management)
## Downloading Dependencies
[Go Modules](https://blog.golang.org/using-go-modules) can now be used for dependency management.
To download the dependencies, run the below command.
```commandline
go mod download
```
_Note that you would require Go version 1.11+ to be able to use go modules._
## Build and Run
Compile the source code using the `go build` tool as shown below.