terraform-provider-google/vendor/github.com/hashicorp/terraform/plans/objchange/all_null.go
Riley Karson dbf9188792
Vendor 0.12 SDK (#3432)
```bash
GO111MODULE=on go get github.com/hashicorp/terraform@pluginsdk-v0.12-early7
GO111MODULE=on go mod vendor
GO111MODULE=on go mod tidy
```
2019-04-15 13:39:47 -07:00

19 lines
692 B
Go

package objchange
import (
"github.com/hashicorp/terraform/configs/configschema"
"github.com/zclconf/go-cty/cty"
)
// AllAttributesNull constructs a non-null cty.Value of the object type implied
// by the given schema that has all of its leaf attributes set to null and all
// of its nested block collections set to zero-length.
//
// This simulates what would result from decoding an empty configuration block
// with the given schema, except that it does not produce errors
func AllAttributesNull(schema *configschema.Block) cty.Value {
// "All attributes null" happens to be the definition of EmptyValue for
// a Block, so we can just delegate to that.
return schema.EmptyValue()
}