Documentation
¶
Overview ¶
Package egCal provides generic calculation functionalities.
egCal provides the generic calculation functionalities from
consul template functions https://github.com/hashicorp/consul-template / template_functions.go
Example ¶
for standalone test, change package to `main` and the next func def to, func main() {
package main import ( "os" "github.com/go-easygen/easygen" "github.com/go-easygen/easygen/egCal" "github.com/go-easygen/easygen/egVar" ) // for standalone test, change package to `main` and the next func def to, // func main() { func main() { tmpl0 := easygen.NewTemplate().Customize() tmpl := tmpl0.Funcs(easygen.FuncDefs()).Funcs(egVar.FuncDefs()).Funcs(egCal.FuncDefs()) err := easygen.Process0(tmpl, os.Stdout, "{{.Name}}: {{clk2uc .Name}} {{clk2ss .Name}}\n"+ "Cal: {{add 2 3}}, {{multiply 2 3}}, {{subtract 9 2}}, {{divide 24 3}}\n", "../test/var0") if err != nil { panic(err) } } // To show the full code in GoDoc type dummy struct { }
Output: some-init-method: SomeInitMethod SOME_INIT_METHOD Cal: 5, 6, 7, 8
Index ¶
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Divide ¶
func Divide(a, b interface{}) (interface{}, error)
Divide returns the division of b from a.
Types ¶
Click to show internal directories.
Click to hide internal directories.