diff --git a/docs/getting-started/new-project-guide/go_lang.md b/docs/getting-started/new-project-guide/go_lang.md index 94ab41707..62fde91d6 100644 --- a/docs/getting-started/new-project-guide/go_lang.md +++ b/docs/getting-started/new-project-guide/go_lang.md @@ -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` diff --git a/projects/golang-protobuf/Dockerfile b/projects/golang-protobuf/Dockerfile index 85803b741..1347a7691 100644 --- a/projects/golang-protobuf/Dockerfile +++ b/projects/golang-protobuf/Dockerfile @@ -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