mirror of
https://gitea.com/Lydanne/buildx.git
synced 2025-07-09 21:17:09 +08:00
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:
8
vendor/github.com/zclconf/go-cty/cty/function/stdlib/bytes.go
generated
vendored
8
vendor/github.com/zclconf/go-cty/cty/function/stdlib/bytes.go
generated
vendored
@ -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)
|
||||
|
||||
|
Reference in New Issue
Block a user