gogentools

package
v0.0.0-...-a699420 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 21, 2021 License: MIT Imports: 8 Imported by: 6

Documentation

Overview

Package gogentools contains tools that help with Go code generation.

Index

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

func ComposeTypeDeclaration(file *File, stat *Statement, typ types.Type)

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 ComposeZeroDeclaration(file *File, stat *Statement, typ types.Type)

func ImportPackage

func ImportPackage(file *File, pkgPath string, pkgName string)

func MustVarName

func MustVarName(name string) string

func MustVarNameWithDefaultPrefix

func MustVarNameWithDefaultPrefix(name string, prefix string) string

func NewNameWithPrefix

func NewNameWithPrefix(prefix string) string

func ScanTupleOfTypes

func ScanTupleOfTypes(file *File, tuple *types.Tuple, isVariadic bool) []Code

func ScanTupleOfZeroValues

func ScanTupleOfZeroValues(file *File, tuple *types.Tuple, isVariadic bool) []Code

func ShouldUseAlias

func ShouldUseAlias(pkgPath string, pkgName string) bool

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL