//========================================================================== // list0 data + string template // I.e.: EasyGen -ts "{{range .Colors}}{{.}}, {{end}}" test/list0 func ExampleList0StrTemplate() { fmt.Print(easygenapi.Generate0(false, "{{range .Colors}}{{.}}, {{end}}", "test/list0")) // Output: // red, blue, white, }
func ExampleTestStringSplit0() { fmt.Print(easygenapi.Generate0(false, `{{split .Colorlist}}`, "test/list0")) // Output: // [red blue white] }
func ExampleTestStringSplit1() { fmt.Print(easygenapi.Generate0(false, `{{range (split .Colorlist)}}{{.}} {{end}}`, "test/list0")) // Output: // red blue white }
func ExampleTestStringsCmp() { fmt.Print(easygenapi.Generate0(false, `The {{if eq .StrTest "-AB-axxb- HTML Html html"}}eq says Yea{{else}}eq says Nay{{end}} but {{if eqf .StrTest "-AB-axxb- HTML Html html"}}eqf says Yea{{else}}eqf says Nay{{end}}.`, "test/strings0")) // Output: // The eq says Nay but eqf says Yea. }