code: func (r *Resource) getResourceType(resourceTypes map[string]ResourceType) (*ResourceType, error) {
  	// check if it's specify a resource type to inherit
  	if r.Type == nil || r.Type.Name == "" {
  		return nil, nil
  	}
  
  	// get resource type from array of resource type map
  	for k, rt := range resourceTypes {
  		if k == r.Type.Name {
  			return &rt, nil
  		}
  	}
  	return nil, fmt.Errorf("can't find resource type named :%v", r.Type.Name)
  }
docs: // get resource type from which this resource will inherit