INNER CODE UNIT · Go
main
reactive-tech/kubegres · cmd/yamlcopy/WriteYamlTemplatesInGoFile.go:45
func main() {
entries, _ := os.ReadDir(yamlTemplateDir)
out, _ := os.Create(destinationGoFile)
out.Write([]byte("package yaml " +
"\n\n // This file is auto generated by 'WriteYamlTemplatesInGoFile.go'. " +
"\n // Any manual modification to this file will be lost during next compilation. " +
"\n\nconst (\n"))
fmt.Println("Setting constants in the file: '" + destinationGoFile + "', by copying the YAML contents of the following files:")
for _, entry := range entries {
fileInfo, _ := entry.Info()
if strings.HasSuffix(fileInfo.Name(), ".yaml") {
templateYamlFilePath := yamlTemplateDir + "/" + fileInfo.Name()
fmt.Println("- '" + templateYamlFilePath + "'")