code: func trimPaths(paths []cty.Path) []cty.Path {
  	var trimmed []cty.Path
  	for _, path := range paths {
  		path = trimPath(path)
  		if len(path) > 0 {
  			trimmed = append(trimmed, path)
  		}
  	}
  	return trimmed
  }
docs: // trimPaths removes any trailing steps that aren't of type GetAttrSet, since
  // only an attribute itself can require replacement