Skip to content

Commit 8daea5f

Browse files
committed
fix: Set GOEXPERIMENT environment variable
The current Trivy library depends on experimental go modules that require this flag.
1 parent e475a10 commit 8daea5f

File tree

4 files changed

+6
-2
lines changed

4 files changed

+6
-2
lines changed

.circleci/config.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ workflows:
2626
- codacy/shell:
2727
name: generate_and_test
2828
cmd: |
29+
go env -w GOEXPERIMENT=jsonv2
2930
go generate ./...
3031
go test ./...
3132
requires:

Dockerfile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM golang:1.24-alpine as builder
1+
FROM golang:1.25-alpine as builder
22

33
ARG TRIVY_VERSION=dev
44
ENV TRIVY_VERSION=$TRIVY_VERSION
@@ -8,6 +8,7 @@ WORKDIR /src
88
COPY go.mod go.mod
99
COPY go.sum go.sum
1010

11+
RUN go env -w GOEXPERIMENT=jsonv2
1112
RUN --mount=type=cache,target=/go/pkg/mod \
1213
go mod download
1314
RUN go mod verify

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22

33
This is the docker engine we use at Codacy to have [Trivy](https://github.com/aquasecurity/trivy) support.
44

5+
> [!IMPORTANT]
6+
> For local development, please run `go env -w GOEXPERIMENT=jsonv2`, since the current Trivy library depends on experimental go modules.
7+
58
## Usage
69

710
You can create the docker by doing:

go.sum

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,6 @@ github.com/AzureAD/microsoft-authentication-library-for-go v1.5.0/go.mod h1:HKpQ
7878
github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
7979
github.com/BurntSushi/toml v1.5.0 h1:W5quZX/G/csjUnuI8SUYlsHs9M38FC7znL0lIO+DvMg=
8080
github.com/BurntSushi/toml v1.5.0/go.mod h1:ukJfTF/6rtPPRCnwkur4qwRxa8vTRFBF0uk2lLoLwho=
81-
github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo=
8281
github.com/CycloneDX/cyclonedx-go v0.9.3 h1:Pyk/lwavPz7AaZNvugKFkdWOm93MzaIyWmBwmBo3aUI=
8382
github.com/CycloneDX/cyclonedx-go v0.9.3/go.mod h1:vcK6pKgO1WanCdd61qx4bFnSsDJQ6SbM2ZuMIgq86Jg=
8483
github.com/DATA-DOG/go-sqlmock v1.5.2 h1:OcvFkGmslmlZibjAjaHm3L//6LiuBgolP7OputlJIzU=

0 commit comments

Comments
 (0)