From 4171ec17a5e2bcf8d942ac05edec428d536db9cf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan-Otto=20Kr=C3=B6pke?= Date: Thu, 4 Sep 2025 23:50:27 +0200 Subject: [PATCH] chore: switch to go.yaml.in/yaml/v3 (#2196) --- go.mod | 3 ++- go.sum | 2 ++ internal/collector/performancecounter/performancecounter.go | 2 +- internal/collector/performancecounter/types.go | 2 +- internal/config/config.go | 2 +- internal/config/flatten_test.go | 2 +- 6 files changed, 8 insertions(+), 5 deletions(-) diff --git a/go.mod b/go.mod index 22f5e694..51d0e609 100644 --- a/go.mod +++ b/go.mod @@ -12,8 +12,8 @@ require ( github.com/prometheus/common v0.65.0 github.com/prometheus/exporter-toolkit v0.14.0 github.com/stretchr/testify v1.10.0 + go.yaml.in/yaml/v3 v3.0.4 golang.org/x/sys v0.35.0 - gopkg.in/yaml.v3 v3.0.1 ) require ( @@ -37,4 +37,5 @@ require ( golang.org/x/text v0.28.0 // indirect google.golang.org/protobuf v1.36.7 // indirect gopkg.in/yaml.v2 v2.4.0 // indirect + gopkg.in/yaml.v3 v3.0.1 // indirect ) diff --git a/go.sum b/go.sum index 26620709..4187128c 100644 --- a/go.sum +++ b/go.sum @@ -67,6 +67,8 @@ github.com/xhit/go-str2duration/v2 v2.1.0 h1:lxklc02Drh6ynqX+DdPyp5pCKLUQpRT8bp8 github.com/xhit/go-str2duration/v2 v2.1.0/go.mod h1:ohY8p+0f07DiV6Em5LKB0s2YpLtXVyJfNt1+BlmyAsU= go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE= +go.yaml.in/yaml/v3 v3.0.4 h1:tfq32ie2Jv2UxXFdLJdh3jXuOzWiL1fo0bu/FbuKpbc= +go.yaml.in/yaml/v3 v3.0.4/go.mod h1:DhzuOOF2ATzADvBadXxruRBLzYTpT36CKvDb3+aBEFg= golang.org/x/crypto v0.41.0 h1:WKYxWedPGCTVVl5+WHSSrOBT0O8lx32+zxmHxijgXp4= golang.org/x/crypto v0.41.0/go.mod h1:pO5AFd7FA68rFak7rOAGVuygIISepHftHnr8dr6+sUc= golang.org/x/net v0.43.0 h1:lat02VYK2j4aLzMzecihNvTlJNQUq316m2Mr9rnM6YE= diff --git a/internal/collector/performancecounter/performancecounter.go b/internal/collector/performancecounter/performancecounter.go index d68e7423..d71c2f77 100644 --- a/internal/collector/performancecounter/performancecounter.go +++ b/internal/collector/performancecounter/performancecounter.go @@ -32,7 +32,7 @@ import ( "github.com/prometheus-community/windows_exporter/internal/pdh" "github.com/prometheus-community/windows_exporter/internal/types" "github.com/prometheus/client_golang/prometheus" - "gopkg.in/yaml.v3" + "go.yaml.in/yaml/v3" ) const Name = "performancecounter" diff --git a/internal/collector/performancecounter/types.go b/internal/collector/performancecounter/types.go index f5293a4f..29f2c53e 100644 --- a/internal/collector/performancecounter/types.go +++ b/internal/collector/performancecounter/types.go @@ -19,7 +19,7 @@ package performancecounter import ( "github.com/prometheus-community/windows_exporter/internal/pdh" - "gopkg.in/yaml.v3" + "go.yaml.in/yaml/v3" ) type Object struct { diff --git a/internal/config/config.go b/internal/config/config.go index 7d7c6307..da311d89 100644 --- a/internal/config/config.go +++ b/internal/config/config.go @@ -26,7 +26,7 @@ import ( "github.com/alecthomas/kingpin/v2" "github.com/prometheus-community/windows_exporter/pkg/collector" - "gopkg.in/yaml.v3" + "go.yaml.in/yaml/v3" ) // configFile represents the structure of the windows_exporter configuration file, diff --git a/internal/config/flatten_test.go b/internal/config/flatten_test.go index 4a092cdf..89d9bbd3 100644 --- a/internal/config/flatten_test.go +++ b/internal/config/flatten_test.go @@ -21,7 +21,7 @@ import ( "reflect" "testing" - "gopkg.in/yaml.v3" + "go.yaml.in/yaml/v3" ) // Unmarshal good configuration file and confirm data is flattened correctly.