mirror of
https://github.com/letic/terraform-provider-google.git
synced 2024-09-18 17:19:58 +00:00
dbf9188792
```bash GO111MODULE=on go get github.com/hashicorp/terraform@pluginsdk-v0.12-early7 GO111MODULE=on go mod vendor GO111MODULE=on go mod tidy ```
19 lines
692 B
Go
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()
|
|
}
|