Documentation
¶
Index ¶
- Constants
- func AreFilesIdentical(originalPath, generatedPath string, filters []*regexp.Regexp) (bool, error)
- func CopyTree(src string, dest string) error
- func CreateTemp(name string, directory bool) (string, func(), error)
- func Install(src, dest, destdir, prefix string) error
- func InstallCheckFlags() (check *bool, verbose *bool)
- func IsCheckMode(checkMode bool) bool
- type GenCode
- type Generator
Constants ¶
const DefaultPrefix = "/usr/local"
DefaultPrefix used as prefix
Variables ¶
This section is empty.
Functions ¶
func AreFilesIdentical ¶
AreFilesIdentical compares orginal and generated files. filters regexps are used to ignore dates and other potential differences. TODO: will probably be better with some io.Reader
func CreateTemp ¶
CreateTemp creates a temporary file and directory while returning teardown function
func Install ¶
Install copies src to dest, prefixing as needed destdir/prefix/ and making sanity checks
func InstallCheckFlags ¶
InstallCheckFlags returns check specific flags
func IsCheckMode ¶
IsCheckMode enhanced checkmod with an env variable GOGENERATE_CHECK
Types ¶
type GenCode ¶
type GenCode struct { Generator Dest string CheckMode bool Verbose bool IgnoreInCheckFilters []*regexp.Regexp FilesToIgnore []string Close func() // contains filtered or unexported fields }
GenCode is the struct used to defined Generation, checking and cleanup
func (*GenCode) GenerateAndCheck ¶
GenerateAndCheck will generate from Generator, and optionally check if the generation is fine. Output should be cleaned up by using Close()