code: func (c *collectRun) summarizeResults(results []taskResult) ([]byte, error) {
  	if c.taskSummaryPython {
  		return summarizeResultsPython(results)
  	}
  
  	jsonResults := map[string]interface{}{}
  	for _, result := range results {
  		jsonResult := map[string]interface{}{}
  		if result.err != nil {
  			jsonResult["error"] = result.err.Error()
  		}
  		if result.result != nil {
  			jsonResult["results"] = *result.result
  			if c.taskOutput.includesJSON() {
  				jsonResult["output"] = result.output
  			}
  			jsonResult["outputs"] = result.outputs
  		}
  		jsonResults[result.taskID] = jsonResult
  	}
  	return json.MarshalIndent(jsonResults, "", "  ")
  }
docs: // summarizeResults generate a marshalled JSON summary of the task results.