terraform-provider-gitea/vendor/github.com/hashicorp/terraform-plugin-sdk/internal/configs/configschema/implied_type.go
Malar Invention 00ebcd295e add vendor
2022-04-03 09:37:16 +05:30

22 lines
654 B
Go

package configschema
import (
"github.com/hashicorp/hcl/v2/hcldec"
"github.com/zclconf/go-cty/cty"
)
// ImpliedType returns the cty.Type that would result from decoding a
// configuration block using the receiving block schema.
//
// ImpliedType always returns a result, even if the given schema is
// inconsistent. Code that creates configschema.Block objects should be
// tested using the InternalValidate method to detect any inconsistencies
// that would cause this method to fall back on defaults and assumptions.
func (b *Block) ImpliedType() cty.Type {
if b == nil {
return cty.EmptyObject
}
return hcldec.ImpliedType(b.DecoderSpec())
}