Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Dir ¶
Dir recursively writes all files in a directory as variables.
The ignore patterns are matched by strings.HasSuffix().
func Header ¶
Header writes a file header, which is a code generation comment and package declaration.
func Pack ¶
Pack data to a Go file.
The data is a map where the key is the filename to store the packed data, and the contents a variable -> contents mapping.
Example:
err := zpack.Pack(map[string]map[string]string{ "./db/pack.go": map[string]string{ "Schema": "./db/schema.sql", }, "./handlers/pack.go": map[string]string{ "packPublic": "./public", "packTpl": "./tpl", }, }) if err != nil { fmt.Fprintln(os.Stderr, err) os.Exit(1) }
The ignore patterns are matched by strings.HasSuffix().
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.