Commit 15b1cff2 authored by Hüseyin Güner's avatar Hüseyin Güner

added go module cache support

parent 97dc741e
......@@ -329,6 +329,31 @@ rspec:
- rspec spec
```
### Caching Go dependencies
Assuming your project is using [Go Modules](https://github.com/golang/go/wiki/Modules) to install
the Go dependencies, the following example defines `cache` globally so that
all jobs inherit it. Go modules are installed in `vendor/` and
are cached per-branch:
```yaml
image: golang:1.13
# Cache libraries in between jobs
cache:
key: ${CI_COMMIT_REF_SLUG}
paths:
- vendor/
before_script:
- go mod vendor
test:
script:
- go test -mod vendor ./... -v -short
```
## Availability of the cache
Caching is an optimization, but isn't guaranteed to always work, so you need to
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment