Documentation ¶
Overview ¶
Package gogentools contains tools that help with Go code generation.
Index ¶
- func ComposeTypeAssertion(file *File, group *Group, varName string, typ types.Type, isVariadic bool)
- func ComposeTypeDeclaration(file *File, stat *Statement, typ types.Type)
- func ComposeVarDeclaration(file *File, group *Group, varName string, typ types.Type, isVariadic bool)
- func ComposeZeroDeclaration(file *File, stat *Statement, typ types.Type)
- func ImportPackage(file *File, pkgPath string, pkgName string)
- func MustVarName(name string) string
- func MustVarNameWithDefaultPrefix(name string, prefix string) string
- func NewNameWithPrefix(prefix string) string
- func ScanTupleOfTypes(file *File, tuple *types.Tuple, isVariadic bool) []Code
- func ScanTupleOfZeroValues(file *File, tuple *types.Tuple, isVariadic bool) []Code
- func ShouldUseAlias(pkgPath string, pkgName string) bool
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ComposeTypeAssertion ¶
func ComposeTypeAssertion(file *File, group *Group, varName string, typ types.Type, isVariadic bool)
declare `name := sourceCQL.(Type)`
func ComposeTypeDeclaration ¶
ComposeTypeDeclaration adds the `Type` inside `var name Type`
func ComposeVarDeclaration ¶
func ComposeVarDeclaration(file *File, group *Group, varName string, typ types.Type, isVariadic bool)
declare `var name Type`
func ComposeZeroDeclaration ¶
func ImportPackage ¶
func MustVarName ¶
func NewNameWithPrefix ¶
func ScanTupleOfTypes ¶
func ScanTupleOfZeroValues ¶
func ShouldUseAlias ¶
ShouldUseAlias tells whether the package name and the base of the backage path are the same; if they are not, then the package should use an alias in the import.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.