diff --git a/cmd/configure/devicetest.go b/cmd/configure/devicetest.go index c6052472d..b035648ed 100644 --- a/cmd/configure/devicetest.go +++ b/cmd/configure/devicetest.go @@ -10,7 +10,7 @@ import ( "github.com/evcc-io/evcc/meter" "github.com/evcc-io/evcc/util/templates" "github.com/evcc-io/evcc/vehicle" - "gopkg.in/yaml.v3" + "go.yaml.in/yaml/v4" ) type DeviceTestResult string diff --git a/cmd/configure/helper.go b/cmd/configure/helper.go index f49bb267a..d09540f83 100644 --- a/cmd/configure/helper.go +++ b/cmd/configure/helper.go @@ -11,7 +11,7 @@ import ( "github.com/evcc-io/evcc/util/sponsor" "github.com/evcc-io/evcc/util/templates" stripmd "github.com/writeas/go-strip-markdown/v2" - "gopkg.in/yaml.v3" + "go.yaml.in/yaml/v4" ) // processDeviceSelection processes the user-selected device, checks diff --git a/cmd/helper.go b/cmd/helper.go index ac649987b..d3d1367b8 100644 --- a/cmd/helper.go +++ b/cmd/helper.go @@ -12,7 +12,7 @@ import ( "github.com/evcc-io/evcc/cmd/shutdown" "github.com/evcc-io/evcc/util" - "gopkg.in/yaml.v3" + "go.yaml.in/yaml/v4" ) // parseLogLevels parses --log area:level[,...] switch into levels per log area diff --git a/go.mod b/go.mod index 0d63a218e..1d1c8837f 100644 --- a/go.mod +++ b/go.mod @@ -98,6 +98,7 @@ require ( github.com/writeas/go-strip-markdown/v2 v2.1.1 gitlab.com/bboehmke/sunny v0.16.0 go.uber.org/mock v0.5.2 + go.yaml.in/yaml/v4 v4.0.0-20250730171608-926dd0b54a90 golang.org/x/crypto v0.40.0 golang.org/x/crypto/x509roots/fallback v0.0.0-20250711192710-b903b535d3ef golang.org/x/exp v0.0.0-20250718183923-645b1fa84792 @@ -108,7 +109,6 @@ require ( golang.org/x/tools v0.35.0 google.golang.org/grpc v1.74.2 google.golang.org/protobuf v1.36.6 - gopkg.in/yaml.v3 v3.0.1 gorm.io/gorm v1.30.1 ) @@ -231,6 +231,7 @@ require ( google.golang.org/genproto/googleapis/rpc v0.0.0-20250528174236-200df99c418a // indirect gopkg.in/go-playground/validator.v9 v9.31.0 // indirect gopkg.in/sourcemap.v1 v1.0.5 // indirect + gopkg.in/yaml.v3 v3.0.1 // indirect modernc.org/libc v1.66.3 // indirect modernc.org/mathutil v1.7.1 // indirect modernc.org/memory v1.11.0 // indirect @@ -245,8 +246,6 @@ tool ( go.uber.org/mock/mockgen ) -replace gopkg.in/yaml.v3 => github.com/andig/yaml v0.0.0-20240531135838-1ff5761ab467 - replace github.com/grid-x/modbus => github.com/evcc-io/modbus v0.0.0-20250501165638-8b6f1fbdb7ea replace github.com/lorenzodonini/ocpp-go => github.com/evcc-io/ocpp-go v0.0.0-20250322092544-c0c6094051c0 diff --git a/go.sum b/go.sum index e5390170d..306bbd527 100644 --- a/go.sum +++ b/go.sum @@ -39,8 +39,6 @@ github.com/andig/gosunspec v0.0.0-20240918203654-860ce51d602b h1:81UMfM949I7StrR github.com/andig/gosunspec v0.0.0-20240918203654-860ce51d602b/go.mod h1:c6P6szcR+ROkqZruOR4f6qbDKFjZX6OitPpj+yJ/r8k= github.com/andig/mbserver v0.0.0-20230310211055-1d29cbb5820e h1:m/NTP3JWpR7M0ljLxiQU4fzR25jjhe1LDtxLMNcoNJQ= github.com/andig/mbserver v0.0.0-20230310211055-1d29cbb5820e/go.mod h1:4VtYzTm//oUipwvO3yh0g/udTE7pYJM+U/kyAuFDsgM= -github.com/andig/yaml v0.0.0-20240531135838-1ff5761ab467 h1:JqIoHxsQSV39xaemvVRu3HOkSf5AbhQ1YEENJa2cL3Q= -github.com/andig/yaml v0.0.0-20240531135838-1ff5761ab467/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= github.com/andybalholm/cascadia v1.3.3 h1:AG2YHrzJIm4BZ19iwJ/DAua6Btl3IwJX+VI4kktS1LM= github.com/andybalholm/cascadia v1.3.3/go.mod h1:xNd9bqTn98Ln4DwST8/nG+H0yuB8Hmgu1YHNnWw0GeA= github.com/antihax/optional v1.0.0 h1:xK2lYat7ZLaVVcIuj82J8kIro4V6kDe0AUDFboUCwcg= @@ -787,6 +785,8 @@ go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN8 go.uber.org/tools v0.0.0-20190618225709-2cfd321de3ee/go.mod h1:vJERXedbb3MVM5f9Ejo0C68/HhF8uaILCdgjnY+goOA= go.uber.org/zap v1.10.0/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= go.uber.org/zap v1.13.0/go.mod h1:zwrFLgMcdUuIBviXEYEH1YKNaOBnKXsx2IPda5bBwHM= +go.yaml.in/yaml/v4 v4.0.0-20250730171608-926dd0b54a90 h1:PK8906uEqvjB6qgonTahH/ZBqrdIv/6mpysTotKxvL0= +go.yaml.in/yaml/v4 v4.0.0-20250730171608-926dd0b54a90/go.mod h1:CBdeces52/nUXndfQ5OY8GEQuNR9uEEOJPZj/Xq5IzU= golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20181029021203-45a5f77698d3/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= @@ -1031,6 +1031,9 @@ gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= +gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= +gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gorm.io/gorm v1.30.1 h1:lSHg33jJTBxs2mgJRfRZeLDG+WZaHYCk3Wtfl6Ngzo4= gorm.io/gorm v1.30.1/go.mod h1:8Z33v652h4//uMA76KjeDH8mJXPm1QNCYrMeatR0DOE= honnef.co/go/tools v0.0.0-20180728063816-88497007e858/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= diff --git a/server/db/settings/setting.go b/server/db/settings/setting.go index 1ddd13451..f6a07d2c3 100644 --- a/server/db/settings/setting.go +++ b/server/db/settings/setting.go @@ -16,7 +16,7 @@ import ( "github.com/evcc-io/evcc/server/db" "github.com/evcc-io/evcc/util" - "gopkg.in/yaml.v3" + "go.yaml.in/yaml/v4" ) var ErrNotFound = errors.New("not found") diff --git a/server/eebus/eebus_test.go b/server/eebus/eebus_test.go index f4dc83abd..12ae581e1 100644 --- a/server/eebus/eebus_test.go +++ b/server/eebus/eebus_test.go @@ -4,7 +4,7 @@ import ( "testing" "github.com/stretchr/testify/require" - "gopkg.in/yaml.v3" + "go.yaml.in/yaml/v4" ) func TestConfig(t *testing.T) { diff --git a/server/http_config_device_handler.go b/server/http_config_device_handler.go index e6b55516a..50f26620b 100644 --- a/server/http_config_device_handler.go +++ b/server/http_config_device_handler.go @@ -18,7 +18,7 @@ import ( "github.com/evcc-io/evcc/util/templates" "github.com/evcc-io/evcc/vehicle" "github.com/gorilla/mux" - "gopkg.in/yaml.v3" + "go.yaml.in/yaml/v4" ) func devicesConfig[T any](class templates.Class, h config.Handler[T]) ([]map[string]any, error) { diff --git a/server/http_config_helper.go b/server/http_config_helper.go index ef7c270e1..cc4f8d7e7 100644 --- a/server/http_config_helper.go +++ b/server/http_config_helper.go @@ -18,7 +18,7 @@ import ( "github.com/evcc-io/evcc/util/templates" "github.com/go-viper/mapstructure/v2" "github.com/samber/lo" - "gopkg.in/yaml.v3" + "go.yaml.in/yaml/v4" ) const ( diff --git a/server/http_global_settings_handler.go b/server/http_global_settings_handler.go index e171ec521..3f9a25aa1 100644 --- a/server/http_global_settings_handler.go +++ b/server/http_global_settings_handler.go @@ -11,7 +11,7 @@ import ( "github.com/evcc-io/evcc/server/db/settings" "github.com/evcc-io/evcc/util" "github.com/gorilla/mux" - "gopkg.in/yaml.v3" + "go.yaml.in/yaml/v4" ) func settingsGetStringHandler(key string) http.HandlerFunc { diff --git a/server/http_site_handler.go b/server/http_site_handler.go index 9b274b50d..2b03f8ad5 100644 --- a/server/http_site_handler.go +++ b/server/http_site_handler.go @@ -26,8 +26,8 @@ import ( "github.com/evcc-io/evcc/util/logstash" "github.com/gorilla/mux" "github.com/itchyny/gojq" + "go.yaml.in/yaml/v4" "golang.org/x/text/language" - "gopkg.in/yaml.v3" ) var ignoreState = []string{"releaseNotes"} // excessive size @@ -99,7 +99,7 @@ func jsonError(w http.ResponseWriter, status int, err error) { var ( ype *yaml.ParserError - yue yaml.UnmarshalError + yue *yaml.UnmarshalError ) switch { case errors.As(err, &ype): diff --git a/util/templates/defaults.go b/util/templates/defaults.go index 82f58579b..0af38a3d0 100644 --- a/util/templates/defaults.go +++ b/util/templates/defaults.go @@ -4,7 +4,7 @@ import ( _ "embed" "fmt" - "gopkg.in/yaml.v3" + "go.yaml.in/yaml/v4" ) //go:embed defaults.yaml diff --git a/util/templates/init.go b/util/templates/init.go index 9075839b3..ced5b6791 100644 --- a/util/templates/init.go +++ b/util/templates/init.go @@ -12,7 +12,7 @@ import ( "github.com/evcc-io/evcc/templates/definition" "github.com/samber/lo" - "gopkg.in/yaml.v3" + "go.yaml.in/yaml/v4" ) var ( diff --git a/util/templates/render_instance.go b/util/templates/render_instance.go index 441129f40..551097ed5 100644 --- a/util/templates/render_instance.go +++ b/util/templates/render_instance.go @@ -6,7 +6,7 @@ import ( "os" "github.com/evcc-io/evcc/util" - "gopkg.in/yaml.v3" + "go.yaml.in/yaml/v4" ) // Instance is an actual instantiated template diff --git a/util/templates/render_testing.go b/util/templates/render_testing.go index e4f284315..e6c84ee63 100644 --- a/util/templates/render_testing.go +++ b/util/templates/render_testing.go @@ -5,7 +5,7 @@ import ( "slices" "testing" - "gopkg.in/yaml.v3" + "go.yaml.in/yaml/v4" ) // test renders and instantiates plus yaml-parses the template per usage diff --git a/util/templates/utils.go b/util/templates/utils.go index f5a0458ae..4c8887f73 100644 --- a/util/templates/utils.go +++ b/util/templates/utils.go @@ -8,7 +8,7 @@ import ( "text/template" "github.com/Masterminds/sprig/v3" - "gopkg.in/yaml.v3" + "go.yaml.in/yaml/v4" ) func yamlQuote(value string) string { diff --git a/util/templates/utils_test.go b/util/templates/utils_test.go index d654dffcd..e2459843f 100644 --- a/util/templates/utils_test.go +++ b/util/templates/utils_test.go @@ -6,7 +6,7 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "gopkg.in/yaml.v3" + "go.yaml.in/yaml/v4" ) func TestYamlDecode(t *testing.T) {