Debian Codegraph @

sarif/helper.go

raw symbols SCIP
1 package sarif
2
3 // NewSarif returns new Sarif instance with default value filled in for Version and
4 // Schema fields.
5 func NewSarif() *Sarif {
6 return &Sarif{
7 Version: The210,
8 Schema: String("https://docs.oasis-open.org/sarif/sarif/v2.1.0/errata01/os/schemas/sarif-schema-2.1.0.json"),
9 }
10 }
11
12 // Helpers to get pointer to primitive types.
13
14 func Bool(v bool) *bool { return &v }
15 func Int(v int) *int { return &v }
16 func Int64(v int64) *int64 { return &v }
17 func Float64(v float64) *float64 { return &v }
18 func String(v string) *string { return &v }
19
20 // Ptr are helpers to get a pointer to enum value as we cannot get a reference
21 // to defined const values.
22
23 func (v Role) Ptr() *Role { return &v }
24 func (v Level) Ptr() *Level { return &v }
25 func (v Content) Ptr() *Content { return &v }
26 func (v BaselineState) Ptr() *BaselineState { return &v }
27 func (v Importance) Ptr() *Importance { return &v }
28 func (v ResultKind) Ptr() *ResultKind { return &v }
29 func (v SuppressionKind) Ptr() *SuppressionKind { return &v }
30 func (v Status) Ptr() *Status { return &v }
31 func (v Version) Ptr() *Version { return &v }
32 func (v ColumnKind) Ptr() *ColumnKind { return &v }