From a1e8e68c74d38b9e2c21d28a7261e2c4eae08635 Mon Sep 17 00:00:00 2001 From: James Lindsay Date: Thu, 8 Aug 2024 14:52:30 +0100 Subject: [PATCH] Fix build with go 1.11 --- features/fixtures/app/Dockerfile | 3 +++ features/fixtures/autoconfigure/Dockerfile | 3 +++ features/fixtures/net_http/Dockerfile | 3 +++ 3 files changed, 9 insertions(+) diff --git a/features/fixtures/app/Dockerfile b/features/fixtures/app/Dockerfile index e046de7..a06a614 100644 --- a/features/fixtures/app/Dockerfile +++ b/features/fixtures/app/Dockerfile @@ -11,6 +11,9 @@ WORKDIR /app/src/github.com/bugsnag/bugsnag-go/v2 # Ensure subsequent steps are re-run if the GO_VERSION variable changes ARG GO_VERSION +# Required for go 1.11 as modules are not enabled by default +ENV GO111MODULE="on" + # Get bugsnag dependencies using a conditional call to run go get or go install based on the go version RUN if [[ $(echo -e "1.11\n$GO_VERSION\n1.16" | sort -V | head -2 | tail -1) == "$GO_VERSION" ]]; then \ echo "Version is between 1.11 and 1.16, running go get"; \ diff --git a/features/fixtures/autoconfigure/Dockerfile b/features/fixtures/autoconfigure/Dockerfile index 2d6db32..8285d65 100644 --- a/features/fixtures/autoconfigure/Dockerfile +++ b/features/fixtures/autoconfigure/Dockerfile @@ -11,6 +11,9 @@ WORKDIR /app/src/github.com/bugsnag/bugsnag-go/v2 # Ensure subsequent steps are re-run if the GO_VERSION variable changes ARG GO_VERSION +# Required for go 1.11 as modules are not enabled by default +ENV GO111MODULE="on" + # Get bugsnag dependencies using a conditional call to run go get or go install based on the go version RUN if [[ $(echo -e "1.11\n$GO_VERSION\n1.16" | sort -V | head -2 | tail -1) == "$GO_VERSION" ]]; then \ echo "Version is between 1.11 and 1.16, running go get"; \ diff --git a/features/fixtures/net_http/Dockerfile b/features/fixtures/net_http/Dockerfile index fb5e526..5afa0bf 100644 --- a/features/fixtures/net_http/Dockerfile +++ b/features/fixtures/net_http/Dockerfile @@ -13,6 +13,9 @@ WORKDIR /app/src/github.com/bugsnag/bugsnag-go/v2 # Ensure subsequent steps are re-run if the GO_VERSION variable changes ARG GO_VERSION +# Required for go 1.11 as modules are not enabled by default +ENV GO111MODULE="on" + # Get bugsnag dependencies using a conditional call to run go get or go install based on the go version RUN if [[ $(echo -e "1.11\n$GO_VERSION\n1.16" | sort -V | head -2 | tail -1) == "$GO_VERSION" ]]; then \ echo "Version is between 1.11 and 1.16, running go get"; \