mirror of
https://gitea.com/Lydanne/buildx.git
synced 2025-07-09 21:17:09 +08:00
vendor: update github.com/zclconf/go-cty to v1.14.4
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
This commit is contained in:
12
vendor/github.com/zclconf/go-cty/cty/json/marshal.go
generated
vendored
12
vendor/github.com/zclconf/go-cty/cty/json/marshal.go
generated
vendored
@ -12,6 +12,9 @@ func marshal(val cty.Value, t cty.Type, path cty.Path, b *bytes.Buffer) error {
|
||||
if val.IsMarked() {
|
||||
return path.NewErrorf("value has marks, so it cannot be serialized as JSON")
|
||||
}
|
||||
if !val.IsKnown() {
|
||||
return path.NewErrorf("value is not known")
|
||||
}
|
||||
|
||||
// If we're going to decode as DynamicPseudoType then we need to save
|
||||
// dynamic type information to recover the real type.
|
||||
@ -24,10 +27,6 @@ func marshal(val cty.Value, t cty.Type, path cty.Path, b *bytes.Buffer) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
if !val.IsKnown() {
|
||||
return path.NewErrorf("value is not known")
|
||||
}
|
||||
|
||||
// The caller should've guaranteed that the given val is conformant with
|
||||
// the given type t, so we'll proceed under that assumption here.
|
||||
|
||||
@ -185,7 +184,10 @@ func marshalDynamic(val cty.Value, path cty.Path, b *bytes.Buffer) error {
|
||||
return path.NewErrorf("failed to serialize type: %s", err)
|
||||
}
|
||||
b.WriteString(`{"value":`)
|
||||
marshal(val, val.Type(), path, b)
|
||||
err = marshal(val, val.Type(), path, b)
|
||||
if err != nil {
|
||||
return path.NewErrorf("failed to serialize value: %s", err)
|
||||
}
|
||||
b.WriteString(`,"type":`)
|
||||
b.Write(typeJSON)
|
||||
b.WriteRune('}')
|
||||
|
Reference in New Issue
Block a user