bumpo compose-go to v2.1.0

Signed-off-by: Guillaume Lours <705411+glours@users.noreply.github.com>
This commit is contained in:
Guillaume Lours
2024-04-23 10:28:28 +02:00
parent 699fa43f7f
commit e3e16ad088
29 changed files with 146 additions and 66 deletions

View File

@ -23,7 +23,7 @@ import (
"github.com/compose-spec/compose-go/v2/tree"
)
func transformKeyValue(data any, p tree.Path) (any, error) {
func transformKeyValue(data any, p tree.Path, ignoreParseError bool) (any, error) {
switch v := data.(type) {
case map[string]any:
return v, nil
@ -32,6 +32,9 @@ func transformKeyValue(data any, p tree.Path) (any, error) {
for _, e := range v {
before, after, found := strings.Cut(e.(string), "=")
if !found {
if ignoreParseError {
return data, nil
}
return nil, fmt.Errorf("%s: invalid value %s, expected key=value", p, e)
}
mapping[before] = after