func (mt MicroBOSHTemplate) CreateMicroBOSHYamlFile(version, path string) (bool, error) { beego.Debug("Create MicroBOSH deployment file : %s", path) if version == "CCI-IaaS3.0" { return utils.CreateYmlFileFromFile(path, mt.microbosh, MicroBOSHTemplateTextV3File) } return utils.CreateYmlFileFromFile(path, mt.microbosh, MicroBOSHTemplateTextV2File) }
Age: "20", } fileDir, _ := os.Getwd() // test.yml //{{.Name}} //{{.Age}} templatefile := filepath.Join(fileDir, "test.yml") templatefile1 := filepath.Join(fileDir, "test1.yml") bytes, _ := ioutil.ReadFile(templatefile) fmt.Println(string(bytes)) bytes1, _ := ioutil.ReadFile(templatefile1) fmt.Println(string(bytes1)) result, errors := utils.CreateYmlFileFromFile("/home/ubuntu/temp/test.yml", p, templatefile, templatefile1) bytes2, _ := ioutil.ReadFile("/home/ubuntu/temp/test.yml") fmt.Println(string(bytes2)) fmt.Println(result) fmt.Println(errors) }) It("Test ...string for args []string", func() { // str := []string{"hello", "kity", "hi", "lucy"} Tarry("hello", "kity", "hi", "lucy") }) It("Test parse from map", func() { mmap := make(map[string]string)
func (vmt VsphereMicroTemplate) CreateMicroBOSHYamlFile(version, path string) (bool, error) { beego.Debug("Create MicroBOSH deployment file : %s", path) return utils.CreateYmlFileFromFile(path, vmt.vsphereMicro, VsphereMicroBOSHTemplateFile) }