This section is empty.


This section is empty.


func ExtractYear

func ExtractYear(fname string) int

ExtractYear returns the copyright year of a Go-HEP header file.

func GenImports

func GenImports(year int, pkg string, w io.Writer, imports ...string)

GenImports adds the provided imports to the given writer.

func GenRFunc

func GenRFunc(w io.Writer, fct RFunc) error

GenRFunc generates the rtree/rfunc.Formula implementation for fct.

func GoFmt

func GoFmt(f *os.File)

GoFmt formats a file using gofmt.

func NewRFuncGenerator

func NewRFuncGenerator(w io.Writer, fct RFunc) (*rfuncGen, error)


type RFunc

type RFunc struct {
	Pkg  string // Name of package hosting the formula to be generated.
	Path string // Import path of the package holding the function.
	Name string // Formula name.
	Def  string // Function name or signature.

RFunc describes which function should be used as a template to implement the rtree/rfunc.Formula interface.