github.com/sandwich-go/boost@v1.3.29/xmap/internal/export.go (about) 1 package main 2 3 import ( 4 "github.com/sandwich-go/boost/internal/log" 5 "github.com/sandwich-go/boost/misc/xtemplate" 6 "github.com/sandwich-go/boost/xmap/internal/template2" 7 ) 8 9 func main() { 10 for _, src := range []struct { 11 Name string 12 FileName string 13 TPL string 14 Args interface{} 15 }{ 16 {Name: "walk", FileName: "./../walk.go", TPL: template2.WalkTPL, Args: template2.GetWalkTPLArgs()}, 17 {Name: "walk_test", FileName: "./../walk_test.go", TPL: template2.WalkTestTPL, Args: template2.GetWalkTPLArgs()}, 18 {Name: "equal", FileName: "./../equal.go", TPL: template2.EqualTPL, Args: template2.GetEqualTPLArgs()}, 19 {Name: "equal_test", FileName: "./../equal_test.go", TPL: template2.EqualTestTPL, Args: template2.GetEqualTPLArgs()}, 20 } { 21 _, err := xtemplate.Execute(src.TPL, src.Args, 22 xtemplate.WithOptionName(src.Name), 23 xtemplate.WithOptionFileName(src.FileName), 24 ) 25 if err != nil { 26 log.Fatal(err.Error()) 27 } 28 } 29 }