2019-03-03 14:12:22 -03:00
|
|
|
---
|
|
|
|
title: Environment Variables
|
|
|
|
series: customization
|
|
|
|
hideFromIndex: true
|
2019-03-24 20:10:30 -03:00
|
|
|
weight: 19
|
2019-03-03 14:12:22 -03:00
|
|
|
---
|
|
|
|
|
|
|
|
Global environment variables to be passed down to all hooks and builds.
|
|
|
|
|
|
|
|
This is useful for `GO111MODULE`, for example. You can have your
|
|
|
|
`.goreleaser.yaml` file like the following:
|
|
|
|
|
|
|
|
```yaml
|
|
|
|
# .goreleaser.yml
|
|
|
|
env:
|
|
|
|
- GO111MODULE=on
|
|
|
|
before:
|
|
|
|
hooks:
|
2019-08-27 14:12:19 -03:00
|
|
|
- go mod tidy
|
2019-03-03 14:12:22 -03:00
|
|
|
builds:
|
|
|
|
- binary: program
|
|
|
|
```
|
|
|
|
|
2019-08-27 14:12:19 -03:00
|
|
|
This way, both `go mod tidy` and the underlying `go build` will have
|
2019-03-03 14:12:22 -03:00
|
|
|
`GO111MODULE` set to `on`.
|
|
|
|
|