Skip to content

Commit

Permalink
feat: raise baseline go version to 1.17 (#53)
Browse files Browse the repository at this point in the history
* feat: raise baseline go version to 1.17

Signed-off-by: nscuro <nscuro@protonmail.com>

* fix: resolve linter issues

Signed-off-by: nscuro <nscuro@protonmail.com>

Signed-off-by: nscuro <nscuro@protonmail.com>
  • Loading branch information
nscuro committed Sep 25, 2022
1 parent 55bc8ad commit 7a2113a
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 9 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/ci.yml
Expand Up @@ -33,7 +33,7 @@ jobs:
- name: Setup Go
uses: actions/setup-go@v3.3.0
with:
go-version: "1.17"
go-version: "1.19"
check-latest: true
- name: Run golangci-lint
uses: golangci/golangci-lint-action@v3.2.0
Expand All @@ -47,9 +47,9 @@ jobs:
strategy:
matrix:
go:
- "1.15"
- "1.16"
- "1.17"
- "1.18"
- "1.19"
steps:
- name: Setup Go
uses: actions/setup-go@v3.3.0
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/goreleaser.yml
Expand Up @@ -21,7 +21,7 @@ jobs:
- name: Setup Go
uses: actions/setup-go@v3.3.0
with:
go-version: "1.17"
go-version: "1.19"
check-latest: true
- name: Install cyclonedx-gomod
uses: CycloneDX/gh-gomod-generate-sbom@v1
Expand Down
4 changes: 4 additions & 0 deletions Makefile
Expand Up @@ -14,5 +14,9 @@ generate:
go generate
.PHONY: generate

lint:
golangci-lint run
.PHONY: lint

all: clean build test
.PHONY: all
2 changes: 1 addition & 1 deletion README.md
Expand Up @@ -31,7 +31,7 @@ Also, checkout the [`examples`](./example_test.go) to get an idea of how this li
| < v0.4.0 | 1.14+ | 1.2 |
| == v0.4.0 | 1.14+ | 1.3 |
| >= v0.5.0 | 1.15+ | 1.4 |
| >= v0.7.0 | 1.15+ | 1.0-1.4 |
| >= v0.7.0 | 1.17+ | 1.0-1.4 |

We're aiming to support all [officially supported](https://golang.org/doc/devel/release.html#policy) Go versions, plus
an additional older version.
Expand Down
5 changes: 2 additions & 3 deletions encode_test.go
Expand Up @@ -21,7 +21,6 @@ import (
"bytes"
"fmt"
"io"
"io/ioutil"
"os"
"path/filepath"
"testing"
Expand Down Expand Up @@ -110,13 +109,13 @@ func TestXmlBOMEncoder_SetPretty(t *testing.T) {

func TestJsonBOMEncoder_EncodeVersion(t *testing.T) {
t.Run(SpecVersion1_0.String(), func(t *testing.T) {
err := NewBOMEncoder(ioutil.Discard, BOMFileFormatJSON).EncodeVersion(NewBOM(), SpecVersion1_0)
err := NewBOMEncoder(io.Discard, BOMFileFormatJSON).EncodeVersion(NewBOM(), SpecVersion1_0)
require.Error(t, err)
require.ErrorContains(t, err, "not supported")
})

t.Run(SpecVersion1_1.String(), func(t *testing.T) {
err := NewBOMEncoder(ioutil.Discard, BOMFileFormatJSON).EncodeVersion(NewBOM(), SpecVersion1_1)
err := NewBOMEncoder(io.Discard, BOMFileFormatJSON).EncodeVersion(NewBOM(), SpecVersion1_1)
require.Error(t, err)
require.ErrorContains(t, err, "not supported")
})
Expand Down
8 changes: 7 additions & 1 deletion go.mod
@@ -1,8 +1,14 @@
module github.com/CycloneDX/cyclonedx-go

go 1.15
go 1.17

require (
github.com/bradleyjkemp/cupaloy/v2 v2.8.0
github.com/stretchr/testify v1.8.0
)

require (
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
)

0 comments on commit 7a2113a

Please sign in to comment.