mirror of
https://github.com/kubernetes-sigs/node-feature-discovery.git
synced 2024-12-14 11:57:51 +00:00
source: miscellaneous lint fixes
This commit is contained in:
parent
057f31d7e3
commit
640dc9fbf3
4 changed files with 4 additions and 5 deletions
|
@ -56,9 +56,8 @@ func readPciDevInfo(devPath string, deviceAttrSpec map[string]bool) (PciDeviceIn
|
||||||
if err != nil {
|
if err != nil {
|
||||||
if must {
|
if must {
|
||||||
return info, fmt.Errorf("Failed to read device %s: %s", attr, err)
|
return info, fmt.Errorf("Failed to read device %s: %s", attr, err)
|
||||||
} else {
|
|
||||||
continue
|
|
||||||
}
|
}
|
||||||
|
continue
|
||||||
|
|
||||||
}
|
}
|
||||||
info[attr] = attrVal
|
info[attr] = attrVal
|
||||||
|
|
|
@ -60,7 +60,7 @@ func readUsbDevInfo(devPath string, deviceAttrSpec map[string]bool) (UsbClassMap
|
||||||
classmap := UsbClassMap{}
|
classmap := UsbClassMap{}
|
||||||
info := UsbDeviceInfo{}
|
info := UsbDeviceInfo{}
|
||||||
|
|
||||||
for attr, _ := range deviceAttrSpec {
|
for attr := range deviceAttrSpec {
|
||||||
attrVal, _ := readSingleUsbAttribute(devPath, attr)
|
attrVal, _ := readSingleUsbAttribute(devPath, attr)
|
||||||
if len(attrVal) > 0 {
|
if len(attrVal) > 0 {
|
||||||
info[attr] = attrVal
|
info[attr] = attrVal
|
||||||
|
|
|
@ -140,7 +140,7 @@ func readKconfigGzip(filename string) ([]byte, error) {
|
||||||
func parseKconfig() (map[string]string, error) {
|
func parseKconfig() (map[string]string, error) {
|
||||||
kconfig := map[string]string{}
|
kconfig := map[string]string{}
|
||||||
raw := []byte(nil)
|
raw := []byte(nil)
|
||||||
err := error(nil)
|
var err error
|
||||||
|
|
||||||
// First, try kconfig specified in the config file
|
// First, try kconfig specified in the config file
|
||||||
if len(Config.KconfigFile) > 0 {
|
if len(Config.KconfigFile) > 0 {
|
||||||
|
|
|
@ -24,7 +24,7 @@ type FeatureValue interface {
|
||||||
type BoolFeatureValue bool
|
type BoolFeatureValue bool
|
||||||
|
|
||||||
func (b BoolFeatureValue) String() string {
|
func (b BoolFeatureValue) String() string {
|
||||||
if b == true {
|
if b {
|
||||||
return "true"
|
return "true"
|
||||||
}
|
}
|
||||||
return "false"
|
return "false"
|
||||||
|
|
Loading…
Reference in a new issue