Skip to content

Commit 64e97da

Browse files
committed
Add module
1 parent e0c00fa commit 64e97da

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

osv/json.go

+2
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,7 @@ type Reference struct {
120120
// entry
121121
type Entry struct {
122122
ID string
123+
Module string
123124
Published time.Time
124125
Modified time.Time
125126
Withdrawn *time.Time `json:",omitempty"`
@@ -144,6 +145,7 @@ func Generate(id string, url string, r report.Report) []Entry {
144145
}
145146
entry := Entry{
146147
ID: id,
148+
Module: r.Module,
147149
Published: r.Published,
148150
Modified: lastModified,
149151
Withdrawn: r.Withdrawn,

osv/json_test.go

+4-3
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,8 @@ func TestGenerate(t *testing.T) {
5656

5757
want := []Entry{
5858
{
59-
ID: "GO-1991-0001",
59+
ID: "GO-1991-0001",
60+
Module: "example.com/vulnerable/v2",
6061
Package: Package{
6162
Name: "example.com/vulnerable/v2",
6263
Ecosystem: "go",
@@ -96,8 +97,8 @@ func TestGenerate(t *testing.T) {
9697
},
9798
},
9899
{
99-
100-
ID: "GO-1991-0001",
100+
ID: "GO-1991-0001",
101+
Module: "vanity.host/vulnerable",
101102
Package: Package{
102103
Name: "vanity.host/vulnerable/package",
103104
Ecosystem: "go",

0 commit comments

Comments
 (0)