vendor: update github.com/hashicorp/hcl/v2 to v2.19.1

Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
This commit is contained in:
CrazyMax
2023-10-19 14:49:10 +02:00
parent ad674e2666
commit 34b9a629a0
157 changed files with 20123 additions and 5438 deletions

View File

@ -30,6 +30,7 @@ func BytesVal(buf []byte) cty.Value {
// BytesLen is a Function that returns the length of the buffer encapsulated
// in a Bytes value.
var BytesLenFunc = function.New(&function.Spec{
Description: `Returns the total number of bytes in the given buffer.`,
Params: []function.Parameter{
{
Name: "buf",
@ -37,7 +38,8 @@ var BytesLenFunc = function.New(&function.Spec{
AllowDynamicType: true,
},
},
Type: function.StaticReturnType(cty.Number),
Type: function.StaticReturnType(cty.Number),
RefineResult: refineNonNull,
Impl: func(args []cty.Value, retType cty.Type) (cty.Value, error) {
bufPtr := args[0].EncapsulatedValue().(*[]byte)
return cty.NumberIntVal(int64(len(*bufPtr))), nil
@ -46,6 +48,7 @@ var BytesLenFunc = function.New(&function.Spec{
// BytesSlice is a Function that returns a slice of the given Bytes value.
var BytesSliceFunc = function.New(&function.Spec{
Description: `Extracts a subslice from the given buffer.`,
Params: []function.Parameter{
{
Name: "buf",
@ -63,7 +66,8 @@ var BytesSliceFunc = function.New(&function.Spec{
AllowDynamicType: true,
},
},
Type: function.StaticReturnType(Bytes),
Type: function.StaticReturnType(Bytes),
RefineResult: refineNonNull,
Impl: func(args []cty.Value, retType cty.Type) (cty.Value, error) {
bufPtr := args[0].EncapsulatedValue().(*[]byte)