egCal

package
v4.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 19, 2019 License: MIT, MPL-2.0 Imports: 4 Imported by: 0

Documentation

Overview

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())
	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")

}

// 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 FuncDefs

func FuncDefs() template.FuncMap

FuncDefs returns the custom definition mapping for this specific package.

Types

type EgCal

type EgCal struct {
	*easygen.EgBase
}

EgCal -- EasyGen Calculation

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL