package genroot

import "go-hep.org/x/hep/groot/internal/genroot"

Index

Functions

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)

Types

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.

Source Files

genrfunc.go genroot.go

Version
v0.36.0 (latest)
Published
Nov 15, 2024
Platform
linux/amd64
Imports
15 packages
Last checked
2 days ago

Tools for package owners.