writer

package
v1.1.0-alpha2 Latest Latest
Warning

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

Go to latest
Published: May 1, 2020 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ImportInfo

type ImportInfo struct {
	Name    string
	Differs bool
}

type Writer

type Writer struct {
	// contains filtered or unexported fields
}

func NewWriter

func NewWriter(pkg *packages.Package, basePath string) *Writer

func (*Writer) AddAnonImport

func (w *Writer) AddAnonImport(path string)

func (*Writer) BasePath

func (w *Writer) BasePath() string

func (*Writer) Frame

func (w *Writer) Frame() []byte

func (*Writer) GetSortedImports

func (w *Writer) GetSortedImports() []string

func (*Writer) HasImports

func (w *Writer) HasImports() bool

func (*Writer) Import

func (w *Writer) Import(name, path string) string

func (*Writer) RewritePkgRefs

func (w *Writer) RewritePkgRefs(node ast.Node) ast.Node

func (*Writer) TypeString

func (w *Writer) TypeString(t stdtypes.Type) string

func (*Writer) Write

func (w *Writer) Write(format string, args ...interface{})

func (*Writer) WriteAST

func (w *Writer) WriteAST(node ast.Node)

func (*Writer) WriteConvertType

func (w *Writer) WriteConvertType(assignId, valueId string, f *stdtypes.Var, sliceErr string, declareVar bool)

func (*Writer) WriteDefer

func (w *Writer) WriteDefer(params []string, calls []string, body func())

func (*Writer) WriteEnumStrings

func (w *Writer) WriteEnumStrings(params []string)

func (*Writer) WriteFunc

func (w *Writer) WriteFunc(name, recv string, params, results []string, body func())

func (*Writer) WriteFuncCall

func (w *Writer) WriteFuncCall(id, name string, params []string)

func (*Writer) WriteLn

func (w *Writer) WriteLn()

func (*Writer) WriteSignature

func (w *Writer) WriteSignature(keyvals []string)

func (*Writer) WriteStruct

func (w *Writer) WriteStruct(keyvals []string, assign bool)

func (*Writer) WriteStructAssign

func (w *Writer) WriteStructAssign(keyvals []string)

func (*Writer) WriteStructDefined

func (w *Writer) WriteStructDefined(keyvals []string)

func (*Writer) WriteType

func (w *Writer) WriteType(name string)

func (*Writer) WriteTypeStruct

func (w *Writer) WriteTypeStruct(name string, keyvals []string)

func (*Writer) ZeroValue

func (w *Writer) ZeroValue(t stdtypes.Type) string

Jump to

Keyboard shortcuts

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