Lines Matching defs:args
3 // you may not use this file except in compliance with the License.
6 // http://www.apache.org/licenses/LICENSE-2.0
9 // distributed under the License is distributed on an "AS IS" BASIS,
12 // limitations under the License.
16 import (
18 "io/ioutil"
36 vulnerabilities := make([]Vulnerability, 0, len(matches))
40 value, err := ioutil.ReadFile(match)
45 v, err := parseVulnerability(name, string(value))
49
50 vulnerabilities = append(vulnerabilities, v)
53 return vulnerabilities, nil
56 // Vulnerability represents a single vulnerability extracted from /sys/devices/system/cpu/vulnerabi…
57 type Vulnerability struct {
60 Mitigation string
63 func parseVulnerability(name, value string) (Vulnerability, error) {
66 if value == notAffected {
71 if strings.HasPrefix(value, vulnerable) {
72 v.State = vulnerable
77 if strings.HasPrefix(value, mitigation) {
78 v.State = mitigation
83 return v, fmt.Errorf("unknown vulnerability state for %s: %s", name, value)