doc: contributing guide.

This commit is contained in:
Fernandez Ludovic 2019-08-11 12:21:19 +02:00 committed by Traefiker Bot
parent 51b0508512
commit 5d01452648

View file

@ -58,7 +58,10 @@ PRE_TARGET= make test-unit
### Method 2: Using `go`
You need `go` v1.12+.
Requirements:
- `go` v1.12+
- environment variable `GO111MODULE=on`
!!! tip "Source Directory"
@ -100,7 +103,7 @@ Beforehand, you need to get `go-bindata` (the first time) in order to be able to
cd ~/go/src/github.com/containous/traefik
# Get go-bindata. (Important: the ellipses are required.)
go get github.com/containous/go-bindata/...
GO111MODULE=off go get github.com/containous/go-bindata/...
# Let's build
@ -118,29 +121,6 @@ You will find the Traefik executable (`traefik`) in the `~/go/src/github.com/con
If you happen to update the provider's templates (located in `/templates`), you must run `go generate` to update the `autogen` package.
### Setting up dependency management
The [dep](https://github.com/golang/dep) command is not required for building;
however, it is necessary if you need to update the dependencies (i.e., add, update, or remove third-party packages).
You need [dep](https://github.com/golang/dep) >= 0.5.4.
If you want to add a dependency, use `dep ensure -add` to have [dep](https://github.com/golang/dep) put it into the vendor folder and update the dep manifest/lock files (`Gopkg.toml` and `Gopkg.lock`, respectively).
A following `make dep-prune` run should be triggered to trim down the size of the vendor folder.
The final result must be committed into VCS.
Here's a full example using dep to add a new dependency:
```bash
# install the new main dependency github.com/foo/bar and minimize vendor size
$ dep ensure -add github.com/foo/bar
# generate (Only required to integrate other components such as web dashboard)
$ go generate
# Standard go build
$ go build ./cmd/traefik
```
## Testing
### Method 1: `Docker` and `make`