1
0
Fork 0
mirror of https://github.com/kubernetes-sigs/node-feature-discovery.git synced 2024-12-15 17:50:49 +00:00

source: miscellaneous lint fixes

This commit is contained in:
Markus Lehtonen 2020-05-19 16:39:02 +03:00
parent 057f31d7e3
commit 640dc9fbf3
4 changed files with 4 additions and 5 deletions

View file

@ -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

View file

@ -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

View file

@ -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 {

View file

@ -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"