Skip to content

Commit 2b05def

Browse files
committed
fix: linter issues
1 parent 5a45e43 commit 2b05def

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

collector/system_collector.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -503,7 +503,7 @@ func parseEthernetInterface(ch chan<- prometheus.Metric, systemHostName string,
503503
func parsePcieFunction(ch chan<- prometheus.Metric, systemHostName string, pcieFunction *redfish.PCIeFunction, wg *sync.WaitGroup) {
504504
defer wg.Done()
505505
pcieFunctionName := pcieFunction.Name
506-
pcieFunctionID := fmt.Sprint("%v", pcieFunction.ID)
506+
pcieFunctionID := fmt.Sprintf("%v", pcieFunction.ID)
507507
pciFunctionDeviceclass := fmt.Sprintf("%v", pcieFunction.DeviceClass)
508508
pciFunctionType := fmt.Sprintf("%v", pcieFunction.FunctionType)
509509
pciFunctionState := pcieFunction.Status.State

main.go

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,10 @@ func reloadHandler(configLoggerCtx *alog.Entry) http.HandlerFunc {
6262
configLoggerCtx.WithField("operation", "sc.ReloadConfig").Info("config file reloaded")
6363

6464
w.WriteHeader(http.StatusOK)
65-
io.WriteString(w, "Configuration reloaded successfully!")
65+
_, err = io.WriteString(w, "Configuration reloaded successfully!")
66+
if err != nil {
67+
configLoggerCtx.Warn("failed to send configuration reload status message")
68+
}
6669
} else {
6770
http.Error(w, "Only PUT and POST methods are allowed", http.StatusBadRequest)
6871
}
@@ -136,7 +139,7 @@ func main() {
136139
configLoggerCtx.WithField("operation", "sc.ReloadConfig").Info("config file loaded")
137140

138141
// load config in background to watch for config changes
139-
hup := make(chan os.Signal)
142+
hup := make(chan os.Signal, 1)
140143
reloadCh = make(chan chan error)
141144
signal.Notify(hup, syscall.SIGHUP)
142145

@@ -166,6 +169,7 @@ func main() {
166169
http.Handle("/metrics", promhttp.Handler())
167170

168171
http.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) {
172+
// nolint
169173
w.Write([]byte(`<html>
170174
<head>
171175
<title>Redfish Exporter</title>

0 commit comments

Comments
 (0)