Golang modules documentation (#4711)

* Clones golang-protobuf into the expected directory

* Improves the documentation for golang projects with modules
This commit is contained in:
Catena cyber 2020-11-25 16:40:15 +01:00 committed by GitHub
parent d126898bde
commit 6c9bd20f54
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 2 deletions

View File

@ -69,6 +69,13 @@ your Dockerfile.
RUN go get github.com/ianlancetaylor/demangle
```
In the case you are using modules, the best practice is to `git clone` the repository into the expected `$GOPATH/src` directory.
A usage example from go-coredns project is
```dockerfile
RUN git clone --depth 1 https://github.com/coredns/coredns $GOPATH/src/github.com/coredns/coredns
```
### build.sh
In order to build a Go fuzz target, you need to call `go-fuzz`

View File

@ -20,6 +20,6 @@ ENV GO111MODULE="on"
ENV GOFUZZ111MODULE="on"
RUN go get google.golang.org/protobuf/proto
RUN git clone https://go.googlesource.com/protobuf $SRC/protobuf
RUN git clone https://go.googlesource.com/protobuf $GOPATH/src/google.golang.org/protobuf
COPY build.sh $SRC/
WORKDIR $SRC/protobuf
WORKDIR $GOPATH/src/google.golang.org/protobuf