openvex / go-vex

Go module to generate and transform VEX documents
Apache License 2.0
33 stars 15 forks source link

Example in README doesn't compile #60

Closed p-ssanders closed 11 months ago

p-ssanders commented 11 months ago

I'm not fluent in go, so I could be missing something, but as I was trying to use the example in the README I noticed it doesn't seem to compile.

For example, VEX.Vulnerability is a struct, not a string, yet in the README's example:

Vulnerability: "CVE-2023-12345",
cannot use "CVE-2023-12345" (untyped string constant) as vex.Vulnerability value in struct literal

Similarly, VEX.Products is a list of Product struct, not a []string, yet in the README's example:

Products: []string{
    "pkg:oci/git@sha256:23a264e6e429852221a963e9f17338ba3f5796dc7086e46439a6f4482cf6e0cb",
},

Same goes for VEX.Subcomponents.

To help me get started, I ended up writing my own example, based the example in the spec

If I've got this wrong somehow, I'm happy to learn :) Thanks!

p-ssanders commented 11 months ago

Resolved by https://github.com/openvex/go-vex/pull/57