diff --git a/helper/schema/resource_data.go b/helper/schema/resource_data.go index fcb44a2f8..15aa0b5d4 100644 --- a/helper/schema/resource_data.go +++ b/helper/schema/resource_data.go @@ -104,7 +104,7 @@ func (d *ResourceData) GetOk(key string) (interface{}, bool) { return r.Value, exists } -// GetOkRaw returns the data for a given key and whether or not the key +// GetOkExists returns the data for a given key and whether or not the key // has been set to a non-zero value. This is only useful for determining // if boolean attributes have been set, if they are Optional but do not // have a Default value. @@ -114,7 +114,7 @@ func (d *ResourceData) GetOk(key string) (interface{}, bool) { // without a default, to fully check for a literal assignment, regardless // of the zero-value for that type. // This should only be used if absolutely required/needed. -func (d *ResourceData) GetOkRaw(key string) (interface{}, bool) { +func (d *ResourceData) GetOkExists(key string) (interface{}, bool) { r := d.getRaw(key, getSourceSet) exists := r.Exists && !r.Computed return r.Value, exists diff --git a/helper/schema/resource_data_test.go b/helper/schema/resource_data_test.go index bb79f2bca..27041f066 100644 --- a/helper/schema/resource_data_test.go +++ b/helper/schema/resource_data_test.go @@ -1082,7 +1082,7 @@ func TestResourceDataGetOk(t *testing.T) { } } -func TestResourceDataGetOkRaw(t *testing.T) { +func TestResourceDataGetOkExists(t *testing.T) { cases := []struct { Name string Schema map[string]*Schema @@ -1266,7 +1266,7 @@ func TestResourceDataGetOkRaw(t *testing.T) { t.Fatalf("%s err: %s", tc.Name, err) } - v, ok := d.GetOkRaw(tc.Key) + v, ok := d.GetOkExists(tc.Key) if s, ok := v.(*Set); ok { v = s.List() }