render

package
v1.10.0 Latest Latest
Warning

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

Go to latest
Published: Nov 26, 2026 License: Apache-2.0 Imports: 11 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Render added in v1.7.0

type Render struct {
	// contains filtered or unexported fields
}

Render manages template rendering for generating test code.

func New added in v1.7.0

func New() *Render

New creates a new Render instance with default templates and helper functions.

func (*Render) Header added in v1.7.0

func (r *Render) Header(w io.Writer, h *models.Header) error

Header renders the file header including package declaration and imports.

func (*Render) LoadCustomTemplates added in v1.7.0

func (r *Render) LoadCustomTemplates(dir string) error

LoadCustomTemplates allows to load in custom templates from a specified path.

func (*Render) LoadCustomTemplatesName added in v1.7.0

func (r *Render) LoadCustomTemplatesName(name string) error

LoadCustomTemplatesName allows to load in custom templates of a specified name from the templates directory.

func (*Render) LoadFromData added in v1.7.0

func (r *Render) LoadFromData(templateData [][]byte)

LoadFromData allows to load from a data slice

func (*Render) TestFunction added in v1.7.0

func (r *Render) TestFunction(
	w io.Writer,
	f *models.Function,
	printInputs bool,
	subtests bool,
	named bool,
	parallel bool,
	useGoCmp bool,
	params map[string]interface{},
	aiCases []interface{},
	packageTest bool,
	packageName string,
) error

TestFunction renders a test function for the given function signature with the specified options.

Jump to

Keyboard shortcuts

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