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.
18 lines
392 B
YAML
18 lines
392 B
YAML
image: golang:1.12
|
|
|
|
cache:
|
|
paths:
|
|
- /go/pkg/mod/github.com
|
|
- /go/pkg/mod/golang.org
|
|
- /go/pkg/mod/google.golang.org
|
|
|
|
before_script:
|
|
- export GOPATH="/go"
|
|
- mkdir -p $GOPATH/pkg/mod github.com $GOPATH/pkg/mod/golang.org $GOPATH/pkg/mod/google.golang.org
|
|
- cp -r $CI_PROJECT_DIR /elektron
|
|
- cd /elektron
|
|
- go mod download
|
|
|
|
build:
|
|
script:
|
|
- go build -v -o elektron
|