Documentation
¶
Overview ¶
Package gogen contains various useful functions for creating Go source code files.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddParams ¶ added in v1.2.0
AddParams will add standard parameters to the passed ParamSet.
Note that if the filename has no default value then the filename parameter must be set if the file is to be created (if, after parameters are set, makeFile is true). If it does have a value then the option will not be shown in the standard (abridged) help message.
Note also that the makeFile parameter must be set to true. This will panic if it is false.
func GetImportPathOrDie ¶ added in v1.1.0
func GetImportPathOrDie() string
GetImportPathOrDie returns the import path of the current package. Any failure will cause the program to exit.
func GetPackageOrDie ¶ added in v1.1.0
func GetPackageOrDie() string
GetPackageOrDie returns the name of the current package. Any failure will cause the program to exit.
func MakeFileOrDie ¶
MakeFileOrDie creates the file truncating it if it already exists and returning the open file. If an error is detected, it is reported and the program exits
func PrintImports ¶ added in v1.2.0
PrintImports adds the import statements, if any, one per line to the file
Types ¶
This section is empty.