Skip to content

Commit f6bad3a

Browse files
authored
Merge pull request #64 from micahhausler/go-121
2 parents d58b3f3 + dbc2be1 commit f6bad3a

File tree

8 files changed

+20
-21
lines changed

8 files changed

+20
-21
lines changed

.github/workflows/ci-build-test.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ jobs:
1919

2020
- uses: actions/setup-go@93397bea11091df50f3d7e59dc26a7711a8bcfbe # v4.1.0
2121
with:
22-
go-version: '1.19'
22+
go-version: "1.21"
2323
check-latest: true
2424
cache: true
2525

@@ -35,7 +35,7 @@ jobs:
3535

3636
- uses: actions/setup-go@93397bea11091df50f3d7e59dc26a7711a8bcfbe # v4.1.0
3737
with:
38-
go-version: '1.19'
38+
go-version: "1.21"
3939
check-latest: true
4040
cache: true
4141

.github/workflows/verify.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,12 @@ jobs:
1616
- uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0
1717
- uses: actions/setup-go@93397bea11091df50f3d7e59dc26a7711a8bcfbe # v4.1.0
1818
with:
19-
go-version: 1.19
19+
go-version: 1.21
2020
check-latest: true
2121
cache: true
2222

2323
- name: golangci-lint
2424
uses: golangci/golangci-lint-action@3a919529898de77ec3da873e3063ca4b10e7f5cc # v3.7.0
2525
with:
26-
version: v1.50.1
26+
version: v1.54
2727
args: --timeout=5m

go.mod

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
11
module github.com/openvex/go-vex
22

3-
go 1.19
3+
go 1.21
44

55
require (
66
github.com/google/go-cmp v0.5.9
77
github.com/in-toto/in-toto-golang v0.9.0
88
github.com/owenrumney/go-sarif v1.1.1
9-
github.com/sirupsen/logrus v1.9.3
109
gopkg.in/yaml.v3 v3.0.1
1110
)
1211

go.sum

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
github.com/apparentlymart/go-textseg/v13 v13.0.0/go.mod h1:ZK2fH7c4NqDTLtiYLvIkEghdlcqw7yxLeM89kiTRPUo=
22
github.com/codahale/rfc6979 v0.0.0-20141003034818-6a90f24967eb h1:EDmT6Q9Zs+SbUoc7Ik9EfrFqcylYqgPZ9ANSbTAntnE=
3+
github.com/codahale/rfc6979 v0.0.0-20141003034818-6a90f24967eb/go.mod h1:ZjrT6AXHbDs86ZSdt/osfBi5qfexBrKUdONk989Wnk4=
34
github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E=
45
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
56
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
@@ -32,8 +33,6 @@ github.com/secure-systems-lab/go-securesystemslib v0.6.0 h1:T65atpAVCJQK14UA57LM
3233
github.com/secure-systems-lab/go-securesystemslib v0.6.0/go.mod h1:8Mtpo9JKks/qhPG4HGZ2LGMvrPbzuxwfz/f/zLfEWkk=
3334
github.com/shibumi/go-pathspec v1.3.0 h1:QUyMZhFo0Md5B8zV8x2tesohbb5kfbpTi9rBnKh5dkI=
3435
github.com/shibumi/go-pathspec v1.3.0/go.mod h1:Xutfslp817l2I1cZvgcfeMQJG5QnU2lh5tVaaMCl3jE=
35-
github.com/sirupsen/logrus v1.9.3 h1:dueUQJ1C2q9oE3F7wvmSGAaVtTmUizReu6fjN8uqzbQ=
36-
github.com/sirupsen/logrus v1.9.3/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ=
3736
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
3837
github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
3938
github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk=
@@ -48,10 +47,10 @@ golang.org/x/crypto v0.8.0/go.mod h1:mRqEX+O9/h5TFCrQhkgjo2yKi0yYA+9ecGkdQoHrywE
4847
golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks=
4948
golang.org/x/net v0.0.0-20200301022130-244492dfa37a/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
5049
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
51-
golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
5250
golang.org/x/sys v0.8.0 h1:EBmGv8NaZBZTWvrbjNoL6HVt+IVy3QDQpJs7VRIw3tU=
5351
golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
5452
golang.org/x/term v0.7.0 h1:BEvjmm5fURWqcfbSKTdpkDXYBrUS1c0m8agp14W48vQ=
53+
golang.org/x/term v0.7.0/go.mod h1:P32HKFT3hSsZrRxla30E9HqToFYAQPCMs/zFMBUFqPY=
5554
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
5655
golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk=
5756
golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=

pkg/vex/functions_documents_test.go

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -23,28 +23,28 @@ func TestMergeDocumentsWithOptions(t *testing.T) {
2323
require.NoError(t, err)
2424

2525
for _, tc := range []struct {
26-
opts MergeOptions
26+
opts *MergeOptions
2727
docs []*VEX
2828
expectedDoc *VEX
2929
shouldErr bool
3030
}{
3131
// Zero docs should fail
3232
{
33-
opts: MergeOptions{},
33+
opts: &MergeOptions{},
3434
docs: []*VEX{},
3535
expectedDoc: &VEX{},
3636
shouldErr: true,
3737
},
3838
// One doc results in the same doc
3939
{
40-
opts: MergeOptions{},
40+
opts: &MergeOptions{},
4141
docs: []*VEX{doc1},
4242
expectedDoc: doc1,
4343
shouldErr: false,
4444
},
4545
// Two docs, as they are
4646
{
47-
opts: MergeOptions{},
47+
opts: &MergeOptions{},
4848
docs: []*VEX{doc1, doc2},
4949
expectedDoc: &VEX{
5050
Metadata: Metadata{},
@@ -57,7 +57,7 @@ func TestMergeDocumentsWithOptions(t *testing.T) {
5757
},
5858
// Two docs, filter product
5959
{
60-
opts: MergeOptions{
60+
opts: &MergeOptions{
6161
Products: []string{"pkg:apk/wolfi/[email protected]"},
6262
},
6363
docs: []*VEX{doc3, doc4},
@@ -71,7 +71,7 @@ func TestMergeDocumentsWithOptions(t *testing.T) {
7171
},
7272
// Two docs, filter vulnerability
7373
{
74-
opts: MergeOptions{
74+
opts: &MergeOptions{
7575
Vulnerabilities: []string{"CVE-9876-54321"},
7676
},
7777
docs: []*VEX{doc3, doc4},
@@ -84,7 +84,7 @@ func TestMergeDocumentsWithOptions(t *testing.T) {
8484
shouldErr: false,
8585
},
8686
} {
87-
doc, err := MergeDocumentsWithOptions(&tc.opts, tc.docs)
87+
doc, err := MergeDocumentsWithOptions(tc.opts, tc.docs)
8888
if tc.shouldErr {
8989
require.Error(t, err)
9090
continue

pkg/vex/functions_files.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,12 @@ import (
99
"bytes"
1010
"encoding/json"
1111
"fmt"
12+
"log/slog"
1213
"os"
1314
"strings"
1415
"time"
1516

1617
"github.com/openvex/go-vex/pkg/csaf"
17-
"github.com/sirupsen/logrus"
1818
"gopkg.in/yaml.v3"
1919
)
2020

@@ -118,7 +118,7 @@ func Open(path string) (*VEX, error) {
118118
}
119119

120120
if bytes.Contains(data, []byte(`"csaf_version"`)) {
121-
logrus.Info("Abriendo CSAF")
121+
slog.Info("Abriendo CSAF")
122122

123123
doc, err := OpenCSAF(path, []string{})
124124
if err != nil {

pkg/vex/vex.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,14 @@ import (
1010
"encoding/json"
1111
"fmt"
1212
"io"
13+
"log/slog"
1314
"os"
1415
"sort"
1516
"strconv"
1617
"strings"
1718
"time"
1819

1920
"github.com/package-url/packageurl-go"
20-
"github.com/sirupsen/logrus"
2121
)
2222

2323
const (
@@ -103,7 +103,7 @@ func New() VEX {
103103
now := time.Now()
104104
t, err := DateFromEnv()
105105
if err != nil {
106-
logrus.Warn(err)
106+
slog.Warn(err.Error())
107107
}
108108
if t != nil {
109109
now = *t
@@ -156,7 +156,7 @@ func (vexDoc *VEX) EffectiveStatement(product, vulnID string) (s *Statement) {
156156
//
157157
// Deprecated: vex.StatementFromID is deprecated and will be removed in an upcoming version
158158
func (vexDoc *VEX) StatementFromID(id string) *Statement {
159-
logrus.Warn("vex.StatementFromID is deprecated and will be removed in an upcoming version")
159+
slog.Warn("vex.StatementFromID is deprecated and will be removed in an upcoming version")
160160
for i := range vexDoc.Statements {
161161
if string(vexDoc.Statements[i].Vulnerability.Name) == id && len(vexDoc.Statements[i].Products) > 0 {
162162
return vexDoc.EffectiveStatement(vexDoc.Statements[i].Products[0].ID, id)

pkg/vex/vex_test.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,7 @@ func genTestDoc(t *testing.T) VEX {
166166
}
167167

168168
func TestCanonicalHash(t *testing.T) {
169+
//nolint:gosec // Not a credential
169170
goldenHash := `3edda795cc8f075902800f0bb6a24f89b49e7e45fbceea96ce6061097460f139`
170171

171172
otherTS, err := time.Parse(time.RFC3339, "2019-01-22T16:36:43-05:00")

0 commit comments

Comments
 (0)