Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CheckVarname ¶
func FilenameToVarname ¶
filename to variable name conversion:
- replace all invalid characters with underscores
- squash adjacent underscores
- remove trailing underscores
- if first character is a number, prepend an underscore
Returns an error if the filename couldn't be converted (i.e. if it contains only underscores or special characters)
Types ¶
type Generator ¶
type Generator struct {
// contains filtered or unexported fields
}
func New ¶
Create a new bin2go generator with the given package name and input files. Variable names for input files are autogenerated with FilenameToVarname For more granular control, use AddFileVar
func (*Generator) AddFile ¶
Add a file with an autogenerated variable name. The variable name must not already be present.
func (*Generator) AddFileVar ¶
Add a file with the given variable name. The variable name must be valid and not already present.