github.com/sandwich-go/boost@v1.3.29/xmath/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/xmath/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: "math", FileName: "./../math.go", TPL: template2.MathTPL, Args: template2.GetMathTPLArgs()}, 17 {Name: "math_test", FileName: "./../math_test.go", TPL: template2.MathTestTPL, Args: template2.GetMathTPLArgs()}, 18 } { 19 _, err := xtemplate.Execute(src.TPL, src.Args, 20 xtemplate.WithOptionName(src.Name), 21 xtemplate.WithOptionFileName(src.FileName), 22 ) 23 if err != nil { 24 log.Fatal(err.Error()) 25 } 26 } 27 }