mirror of
				https://github.com/ClusterCockpit/cc-metric-collector.git
				synced 2025-11-04 02:35:07 +01:00 
			
		
		
		
	Fix staticcheck warnings (#66)
This commit is contained in:
		@@ -70,10 +70,10 @@ func (m *TempCollector) Init(config json.RawMessage) error {
 | 
			
		||||
	globPattern := filepath.Join("/sys/class/hwmon", "*", "temp*_input")
 | 
			
		||||
	inputFiles, err := filepath.Glob(globPattern)
 | 
			
		||||
	if err != nil {
 | 
			
		||||
		return fmt.Errorf("Unable to glob files with pattern '%s': %v", globPattern, err)
 | 
			
		||||
		return fmt.Errorf("unable to glob files with pattern '%s': %v", globPattern, err)
 | 
			
		||||
	}
 | 
			
		||||
	if inputFiles == nil {
 | 
			
		||||
		return fmt.Errorf("Unable to find any files with pattern '%s'", globPattern)
 | 
			
		||||
		return fmt.Errorf("unable to find any files with pattern '%s'", globPattern)
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	// Get sensor name for each temperature sensor file
 | 
			
		||||
@@ -158,7 +158,7 @@ func (m *TempCollector) Init(config json.RawMessage) error {
 | 
			
		||||
 | 
			
		||||
	// Empty sensors map
 | 
			
		||||
	if len(m.sensors) == 0 {
 | 
			
		||||
		return fmt.Errorf("No temperature sensors found")
 | 
			
		||||
		return fmt.Errorf("no temperature sensors found")
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	// Finished initialization
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user