Yaml: remove empty-stream workaround in favor of go-yaml fix (#30789)

This commit is contained in:
andig 2026-06-14 11:00:54 +02:00 • committed by GitHub
parent 15aa800e65
commit 8f5983c189
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
11 changed files with 15 additions and 36 deletions

View file

@ -15,9 +15,8 @@ import (
"github.com/evcc-io/evcc/server/db"
"github.com/evcc-io/evcc/util"
"github.com/evcc-io/evcc/util/yaml"
"github.com/samber/lo"
goyaml "go.yaml.in/yaml/v4"
"go.yaml.in/yaml/v4"
"gorm.io/gorm"
)
@ -136,7 +135,7 @@ func SetJson(key string, val any) error {
func SetYaml(key string, val any) error {
var b bytes.Buffer
err := goyaml.NewEncoder(&b).Encode(val)
err := yaml.NewEncoder(&b).Encode(val)
if err == nil {
SetString(key, strings.TrimSpace(b.String()))
}

View file

@ -22,9 +22,9 @@ import (
"github.com/evcc-io/evcc/tariff"
"github.com/evcc-io/evcc/util/config"
"github.com/evcc-io/evcc/util/templates"
"github.com/evcc-io/evcc/util/yaml"
"github.com/evcc-io/evcc/vehicle"
"github.com/gorilla/mux"
"go.yaml.in/yaml/v4"
)
func devicesConfig[T any](class templates.Class, h config.Handler[T], hidePrivate bool) ([]map[string]any, error) {

View file

@ -16,9 +16,9 @@ import (
"github.com/evcc-io/evcc/util"
"github.com/evcc-io/evcc/util/config"
"github.com/evcc-io/evcc/util/templates"
"github.com/evcc-io/evcc/util/yaml"
"github.com/go-viper/mapstructure/v2"
"github.com/samber/lo"
"go.yaml.in/yaml/v4"
)
const (

View file

@ -12,8 +12,8 @@ import (
"github.com/evcc-io/evcc/core/keys"
"github.com/evcc-io/evcc/server/db/settings"
"github.com/evcc-io/evcc/util/redact"
"github.com/evcc-io/evcc/util/yaml"
"github.com/gorilla/mux"
"go.yaml.in/yaml/v4"
)
func settingsGetStringHandler(key string) http.HandlerFunc {