code: func CreateReport(w io.Writer, format, rootPath string, issues []*gosec.Issue, metrics *gosec.Metrics, errors map[string][]gosec.Error) error {
  	data := &reportInfo{
  		Errors: errors,
  		Issues: issues,
  		Stats:  metrics,
  	}
  	var err error
  	switch format {
  	case "json":
  		err = reportJSON(w, data)
  	case "yaml":
  		err = reportYAML(w, data)
  	case "csv":
  		err = reportCSV(w, data)
  	case "junit-xml":
  		err = reportJUnitXML(w, data)
  	case "html":
  		err = reportFromHTMLTemplate(w, html, data)
  	case "text":
  		err = reportFromPlaintextTemplate(w, text, data)
  	case "sonarqube":
  		err = reportSonarqube(rootPath, w, data)
  	default:
  		err = reportFromPlaintextTemplate(w, text, data)
  	}
  	return err
  }
docs: // CreateReport generates a report based for the supplied issues and metrics given
  // the specified format. The formats currently accepted are: json, csv, html and text.