code: func SetStringPtr(d *schema.ResourceData, key string, val *string) error {
  	if val == nil {
  		return nil
  	}
  	err := d.Set(key, val)
  	return err
  }
docs: // SetStringPtr sets a ResourceData field depending on if a *string exists or
  // not.  The field is not set if it's nil.