func renderCustomDocumentationReadme()

in scripts/generate-docs/custom_doc.go [164:181]


func renderCustomDocumentationReadme(options generateOptions, packageName string) error {
	readmePath := filepath.Join(options.docTemplatesDir, fmt.Sprintf("%s/docs", packageName), "CustomDocumentationREADME.md")

	content, err := ioutil.ReadFile(readmePath)
	if err != nil {
		return errors.Wrapf(err, "failed to read readme file %s", readmePath)
	}

	outputPath := filepath.Join(options.customDocDir, "doc", packageName, "README.md")

	// Write data to dst
	err = ioutil.WriteFile(outputPath, content, 0644)
	if err != nil {
		return errors.Wrapf(err, "write readme (path: %s)", outputPath)
	}

	return nil
}