blob: d6889c30ff33a611be995a17e0ce2881bb6372df [file] [log] [blame]
// Copyright (c) HashiCorp, Inc.
// SPDX-License-Identifier: MPL-2.0
package jsonfunction
import (
"github.com/zclconf/go-cty/cty"
"github.com/zclconf/go-cty/cty/function"
)
func getReturnType(f function.Function) (cty.Type, error) {
args := make([]cty.Type, 0)
for _, param := range f.Params() {
args = append(args, param.Type)
}
if f.VarParam() != nil {
args = append(args, f.VarParam().Type)
}
return f.ReturnType(args)
}