Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrUnsupported = errors.New("unsupported") MarkerInstr = &ssa.Panic{} )
Functions ¶
Types ¶
type ConverterConfig ¶
type ConverterConfig struct { // ImportNameResolver function to get the actual import name. // Because converting works at function level, only the caller knows actual name of the import. ImportNameResolver ImportNameResolver // NamePrefix prefix added to all new local variables. Must be reasonably unique NamePrefix string // SsaValueRemap is used to replace ssa.Value with the specified ssa.Expr. // Note: Replacing ssa.Expr does not guarantee the correctness of the generated code. // When using it, strictly adhere to the value types. SsaValueRemap map[ssa.Value]ast.Expr // MarkerInstrCallback is called every time a MarkerInstr instruction is encountered. // Callback result is inserted into ast as is MarkerInstrCallback func(vars map[string]types.Type) []ast.Stmt }
func DefaultConfig ¶
func DefaultConfig() *ConverterConfig
type TypeConverter ¶ added in v0.12.0
type TypeConverter struct {
// contains filtered or unexported fields
}
func NewTypeConverted ¶ added in v0.12.0
func NewTypeConverted(resolver ImportNameResolver) *TypeConverter
Click to show internal directories.
Click to hide internal directories.