Skip to content

Commit 7d9297a

Browse files
committed
Use maps.Keys for extracting maps keys
1 parent cd0396d commit 7d9297a

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

go.mod

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
module github.com/hansmi/prometheus-lvm-exporter
22

3-
go 1.22
3+
go 1.22.0
44

55
toolchain go1.22.7
66

@@ -33,6 +33,7 @@ require (
3333
github.com/sergi/go-diff v1.2.0 // indirect
3434
github.com/xhit/go-str2duration/v2 v2.1.0 // indirect
3535
golang.org/x/crypto v0.28.0 // indirect
36+
golang.org/x/exp v0.0.0-20241108190413-2d47ceb2692f // indirect
3637
golang.org/x/net v0.29.0 // indirect
3738
golang.org/x/oauth2 v0.23.0 // indirect
3839
golang.org/x/sys v0.26.0 // indirect

go.sum

+2
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,8 @@ github.com/xhit/go-str2duration/v2 v2.1.0 h1:lxklc02Drh6ynqX+DdPyp5pCKLUQpRT8bp8
6666
github.com/xhit/go-str2duration/v2 v2.1.0/go.mod h1:ohY8p+0f07DiV6Em5LKB0s2YpLtXVyJfNt1+BlmyAsU=
6767
golang.org/x/crypto v0.28.0 h1:GBDwsMXVQi34v5CCYUm2jkJvu4cbtru2U4TN2PSyQnw=
6868
golang.org/x/crypto v0.28.0/go.mod h1:rmgy+3RHxRZMyY0jjAJShp2zgEdOqj2AO7U0pYmeQ7U=
69+
golang.org/x/exp v0.0.0-20241108190413-2d47ceb2692f h1:XdNn9LlyWAhLVp6P/i8QYBW+hlyhrhei9uErw2B5GJo=
70+
golang.org/x/exp v0.0.0-20241108190413-2d47ceb2692f/go.mod h1:D5SMRVC3C2/4+F/DB1wZsLRnSNimn2Sp/NPsCrsv8ak=
6971
golang.org/x/net v0.29.0 h1:5ORfpBpCs4HzDYoodCDBbwHzdR5UrLBZ3sOnUJmFoHo=
7072
golang.org/x/net v0.29.0/go.mod h1:gLkgy8jTGERgjzMic6DS9+SP0ajcu6Xu3Orq/SpETg0=
7173
golang.org/x/oauth2 v0.23.0 h1:PbgcYx2W7i4LvjJWEbf0ngHV6qJYr86PkAV3bXdLEbs=

groupcollector.go

+2-5
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import (
88

99
"github.com/hansmi/prometheus-lvm-exporter/lvmreport"
1010
"github.com/prometheus/client_golang/prometheus"
11+
"golang.org/x/exp/maps"
1112
)
1213

1314
type groupField struct {
@@ -131,11 +132,7 @@ func (c *groupCollector) collect(ch chan<- prometheus.Metric, data *lvmreport.Re
131132
}
132133
}
133134

134-
var details []string
135-
136-
for i := range unknown {
137-
details = append(details, i)
138-
}
135+
details := maps.Keys(unknown)
139136

140137
sort.Strings(details)
141138

0 commit comments

Comments
 (0)