Yaml: remove empty-stream workaround in favor of go-yaml fix (#30789)
This commit is contained in:
parent
15aa800e65
commit
8f5983c189
11 changed files with 15 additions and 36 deletions
|
|
@ -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()))
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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) {
|
||||
|
|
|
|||
|
|
@ -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 (
|
||||
|
|
|
|||
|
|
@ -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 {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue