Skip to content

Commit 64bfdb7

Browse files
committed
fix: GolangCI Lint for nodeexporter
1 parent 843bc16 commit 64bfdb7

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

internal/collector/nodeexporter/linux.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -149,15 +149,15 @@ func (c *NodeExporterCollector) collectSockstat() []collector.Metric {
149149
if len(fields) < 3 {
150150
continue
151151
}
152-
switch {
153-
case fields[0] == "sockets:":
152+
switch fields[0] {
153+
case "sockets:":
154154
// "sockets: used 123"
155155
if fields[1] == "used" {
156156
metrics = append(metrics, collector.NewMetric(
157157
"node.sockstat.sockets_used", parseFloat64(fields[2]), collector.MetricTypeGauge,
158158
).WithDescription("Total sockets in use"))
159159
}
160-
case fields[0] == "TCP:":
160+
case "TCP:":
161161
// "TCP: inuse 5 orphan 0 tw 3 alloc 7 mem 2"
162162
for i := 1; i+1 < len(fields); i += 2 {
163163
switch fields[i] {
@@ -171,7 +171,7 @@ func (c *NodeExporterCollector) collectSockstat() []collector.Metric {
171171
).WithDescription("TCP sockets in TIME_WAIT"))
172172
}
173173
}
174-
case fields[0] == "UDP:":
174+
case "UDP:":
175175
for i := 1; i+1 < len(fields); i += 2 {
176176
if fields[i] == "inuse" {
177177
metrics = append(metrics, collector.NewMetric(

0 commit comments

Comments
 (0)