Documentation
¶
Index ¶
- func BuildDirective(predicate bool) string
- func FindFileBuildTags(pkg *packages.Package, file *ast.File) map[string]*Extent
- func FindPackageBuildTags(pkg *packages.Package) map[string]*Extent
- func FormatCode(ctx context.Context, filePath string, buildTag string) error
- func GenBuildTags(predicate bool) string
- func GenFuncLit(funcType string, body string) string
- func GenImport(pkgName, pkgPath string) string
- func GenNewLine() string
- func GenPkgName(prefix string, nameHint string) string
- func GenReturn(expr string) string
- func GenTmpBuildTags(predicate bool) string
- func GenVarName(prefix string, nameHint string) string
- func GenerateSyntax[Syntax interface{ ... }](info *FileInfo[Syntax], writer io.Writer, ...) error
- func GetNameFromType(ty types.Type) string
- func GetNameFromTypeStr(str string) string
- func GetPkgPathFromType(ty types.Type) string
- func GetPkgPathFromTypeStr(str string) string
- func GetTypesFromType(ty types.Type) []string
- func GetTypesFromTypeStr(str string) []string
- func JoinStringers[S []T, T fmt.Stringer](ss S, sep string) string
- func LoadPackages(ctx context.Context, path string, buildFlags ...string) ([]*packages.Package, error)
- func ReadExtent(reader io.ReaderAt, extent *Extent) (string, error)
- func ReadExtentList(reader io.ReaderAt, extents []*Extent) ([]string, error)
- func ResetTypePkgName(ty types.Type, imports map[string]string, currentPkg string) (ret string, adds map[string]string)
- func ResetTypeStrPkgName(str string, imports map[string]string, currentPkg string) (ret string, adds map[string]string)
- func SetProdBuildTags(ctx context.Context, rootDir string) error
- func SetTmpBuildTags(ctx context.Context, rootDir string) error
- func TmpBuildDirective(predicate bool) string
- func TranslateSyntax[Type, Syntax interface{ ... }](ctx context.Context, rootDir string, firstRun bool, ...) error
- type Extent
- type FileInfo
- type PackageInspector
- type Program
- type ReplaceBlock
- type SyntaxInspector
- type SyntaxTranslator
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BuildDirective ¶
func FindFileBuildTags ¶
func GenBuildTags ¶
func GenFuncLit ¶
func GenNewLine ¶
func GenNewLine() string
func GenPkgName ¶
func GenTmpBuildTags ¶
func GenVarName ¶
func GenerateSyntax ¶
func GetNameFromType ¶
func GetNameFromTypeStr ¶
func GetPkgPathFromType ¶
func GetPkgPathFromTypeStr ¶
func GetTypesFromType ¶
func GetTypesFromTypeStr ¶
func LoadPackages ¶
func ResetTypePkgName ¶
func ResetTypeStrPkgName ¶
func TmpBuildDirective ¶
func TranslateSyntax ¶
func TranslateSyntax[Type, Syntax interface { fmt.Stringer comparable }]( ctx context.Context, rootDir string, firstRun bool, translator SyntaxTranslator[Type, Syntax], ) error
Types ¶
type PackageInspector ¶
type PackageInspector[Syntax interface { fmt.Stringer comparable }] struct { // contains filtered or unexported fields }
func NewPackageInspector ¶
func NewPackageInspector[Syntax interface { fmt.Stringer comparable }](pkg *packages.Package, inpector SyntaxInspector[Syntax]) *PackageInspector[Syntax]
func (*PackageInspector[Syntax]) Inspect ¶
func (i *PackageInspector[Syntax]) Inspect() []*FileInfo[Syntax]
type ReplaceBlock ¶
type SyntaxInspector ¶
type SyntaxTranslator ¶
Click to show internal directories.
Click to hide internal directories.