From c52e698d2fe3fbd60df6ff397f44e7b0ea15a4bc Mon Sep 17 00:00:00 2001 From: nscuro Date: Tue, 4 Jun 2024 19:23:13 +0200 Subject: [PATCH 1/2] feat: raise baseline go version to 1.20 Signed-off-by: nscuro --- .github/workflows/ci.yml | 6 +++--- .github/workflows/goreleaser.yml | 2 +- README.md | 3 ++- go.mod | 2 +- 4 files changed, 7 insertions(+), 6 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 232c48c..cb09054 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -33,7 +33,7 @@ jobs: - name: Setup Go uses: actions/setup-go@cdcb36043654635271a94b9a6d1392de5bb323a7 # tag=v5.0.1 with: - go-version: "1.20" + go-version: "1.22" check-latest: true cache: false - name: Run golangci-lint @@ -49,9 +49,9 @@ jobs: strategy: matrix: go: - - "1.18" - - "1.19" - "1.20" + - "1.21" + - "1.22" steps: - name: Setup Go uses: actions/setup-go@cdcb36043654635271a94b9a6d1392de5bb323a7 # tag=v5.0.1 diff --git a/.github/workflows/goreleaser.yml b/.github/workflows/goreleaser.yml index 8b7d70a..3801bc9 100644 --- a/.github/workflows/goreleaser.yml +++ b/.github/workflows/goreleaser.yml @@ -22,7 +22,7 @@ jobs: - name: Setup Go uses: actions/setup-go@cdcb36043654635271a94b9a6d1392de5bb323a7 # tag=v5.0.1 with: - go-version: "1.20" + go-version: "1.22" check-latest: true - name: Install cyclonedx-gomod uses: CycloneDX/gh-gomod-generate-sbom@efc74245d6802c8cefd925620515442756c70d8f # tag=v2.0.0 diff --git a/README.md b/README.md index 807287e..5b78dc8 100644 --- a/README.md +++ b/README.md @@ -32,7 +32,8 @@ Also, checkout the [`examples`](./example_test.go) to get an idea of how this li | == v0.4.0 | 1.14+ | 1.3 | | >= v0.5.0, < v0.7.0 | 1.15+ | 1.4 | | >= v0.7.0, < v0.8.0 | 1.17+ | 1.0-1.4 | -| >= v0.8.0 | 1.18+ | 1.0-1.5 | +| == v0.8.0 | 1.18+ | 1.0-1.5 | +| >= v0.9.0 | 1.20+ | 1.0-1.6 | We're aiming to support all [officially supported](https://golang.org/doc/devel/release.html#policy) Go versions, plus an additional older version. diff --git a/go.mod b/go.mod index 4d583a3..632cb7b 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,6 @@ module github.com/CycloneDX/cyclonedx-go -go 1.18 +go 1.20 require ( github.com/bradleyjkemp/cupaloy/v2 v2.8.0 From 9166e10fdecaadd8a97ceed9636261d351d90a65 Mon Sep 17 00:00:00 2001 From: nscuro Date: Tue, 4 Jun 2024 19:34:16 +0200 Subject: [PATCH 2/2] fix: `ioutil` -> `io` Signed-off-by: nscuro --- decode.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/decode.go b/decode.go index 508791c..34d2fee 100644 --- a/decode.go +++ b/decode.go @@ -21,7 +21,6 @@ import ( "encoding/json" "encoding/xml" "io" - "io/ioutil" ) type BOMDecoder interface { @@ -41,7 +40,7 @@ type jsonBOMDecoder struct { // Decode implements the BOMDecoder interface. func (j jsonBOMDecoder) Decode(bom *BOM) error { - bytes, err := ioutil.ReadAll(j.reader) + bytes, err := io.ReadAll(j.reader) if err != nil { return err }