1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30
|
package egVar_test
import (
"os"
"github.com/go-easygen/easygen"
"github.com/go-easygen/easygen/egVar"
)
// for standalone test, change package to `main` and the next func def to,
// func main() {
func Example() {
// Equivalent testing on commandline:
// easygen test/listfunc2
tmpl0 := egVar.NewTemplate().Customize()
tmpl := tmpl0.Funcs(easygen.FuncDefs()).Funcs(egVar.FuncDefs())
err := easygen.Process(tmpl, os.Stdout, "../test/listfunc2")
// Output:
// some-init-method 5 5 someInitMethod SomeInitMethod
if err != nil {
panic(err)
}
}
// To show the full code in GoDoc
type dummy struct {
}
|