gocodegen

package
v1.12.7 Latest Latest
Warning

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

Go to latest
Published: Dec 3, 2021 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type GoCodeGenerator

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

GoCodeGenerator generates Go code and formats it

func NewGoCodeGenerator

func NewGoCodeGenerator(tmpl *template.Template) *GoCodeGenerator

NewGoCodeGenerator returns a new GoCodeGenerator

func (*GoCodeGenerator) Generate

func (g *GoCodeGenerator) Generate(name string, param interface{}) ([]byte, error)

Generate executes the template and formats it

func (*GoCodeGenerator) GenerateTo

func (g *GoCodeGenerator) GenerateTo(name string, param interface{}, path string) error

GenerateTo is similar to Generate, but the result is written into the file with the specified path

Jump to

Keyboard shortcuts

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