Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Update the version URLs #59

Merged
merged 1 commit into from
May 14, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 15 additions & 11 deletions v2/sarif/sarif.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,14 @@ import (
type Version string

// Version210 represents Version210 of Sarif
const Version210 Version = "2.1.0"
const (
Version210 Version = "2.1.0"
Version210RTM5 Version = "2.1.0-rtm.5"
)

var versions = map[Version]string{
Version210: "https://json.schemastore.org/sarif-2.1.0-rtm.5.json",
Version210: "https://json.schemastore.org/sarif-2.1.0.json",
Version210RTM5: "https://json.schemastore.org/sarif-2.1.0-rtm.5.json",
}

// Report is the encapsulating type representing a Sarif Report
Expand All @@ -28,17 +32,17 @@ type Report struct {
}

// New Creates a new Report or returns an error
func New(version Version, includeSchema... bool) (*Report, error) {
schema := ""
func New(version Version, includeSchema ...bool) (*Report, error) {
schema := ""

if len(includeSchema) == 0 || includeSchema[0] {
var err error
if len(includeSchema) == 0 || includeSchema[0] {
var err error

schema, err = getVersionSchema(version)
if err != nil {
return nil, err
}
}
schema, err = getVersionSchema(version)
if err != nil {
return nil, err
}
}
return &Report{
Version: string(version),
Schema: schema,
Expand Down