generator

package
v0.0.0-...-ed9fe1d Latest Latest
Warning

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

Go to latest
Published: Aug 2, 2018 License: BSD-3-Clause Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Run

func Run(dir string, g Generator) ([]byte, error)

Run runs a generator on the package directory %s and returns the formatted source

Types

type Generator

type Generator interface {
	Inspect(ast.Node) bool
	GenSource(io.Writer) error
}

type InvalidSourceError

type InvalidSourceError struct {
	Source string
	// contains filtered or unexported fields
}

InvalidSourceError is an error if generated source is unable to compile. Use SourceWithLine() to debug the generated code.

func (*InvalidSourceError) Error

func (e *InvalidSourceError) Error() string

func (*InvalidSourceError) SourceWithLine

func (e *InvalidSourceError) SourceWithLine(all bool) string

SourceWithLine returns the source code with line numbers

Jump to

Keyboard shortcuts

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