helper/schema: better docs

This commit is contained in:
Mitchell Hashimoto 2014-08-15 17:46:05 -07:00
parent 1d9528e595
commit b54acf4a0b
1 changed files with 4 additions and 0 deletions

View File

@ -16,6 +16,10 @@ type ResourceData struct {
} }
// Get returns the data for the given key, or nil if the key doesn't exist. // Get returns the data for the given key, or nil if the key doesn't exist.
//
// The type of the data returned will be according to the schema specified.
// Primitives will be their respective types in Go, lists will always be
// []interface{}, and sub-resources will be map[string]interface{}.
func (d *ResourceData) Get(key string) interface{} { func (d *ResourceData) Get(key string) interface{} {
parts := strings.Split(key, ".") parts := strings.Split(key, ".")
return d.getObject("", parts, d.schema) return d.getObject("", parts, d.schema)