Versions in this module Expand all Collapse all v1 v1.0.0 Oct 14, 2020 Changes in this version + func IsLine(t token) bool + type Code interface + type Dict map[Code]Code + func DictFunc(f func(Dict)) Dict + type File struct + CanonicalPath string + PackagePrefix string + func NewFile(packageName string) *File + func NewFilePath(packagePath string) *File + func NewFilePathName(packagePath, packageName string) *File + func (f *File) Anon(paths ...string) + func (f *File) CgoPreamble(comment string) + func (f *File) GoString() string + func (f *File) HeaderComment(comment string) + func (f *File) ImportAlias(path, alias string) + func (f *File) ImportName(path, name string) + func (f *File) ImportNames(names map[string]string) + func (f *File) PackageComment(comment string) + func (f *File) PackageCommentf(comment string, args ...interface{}) + func (f *File) Render(w io.Writer) error + func (f *File) Save(filename string) error + type Group struct + func (g *Group) Add(code ...Code) *Statement + func (g *Group) AddressOf() *Statement + func (g *Group) And() *Statement + func (g *Group) Append(args ...Code) *Statement + func (g *Group) AppendFunc(f func(*Group)) *Statement + func (g *Group) Assert(typ Code) *Statement + func (g *Group) Assign() *Statement + func (g *Group) BitwiseOR() *Statement + func (g *Group) BitwiseXOR() *Statement + func (g *Group) BlockFunc(f func(*Group)) *Statement + func (g *Group) Body(statements ...Code) *Statement + func (g *Group) Bool() *Statement + func (g *Group) Break() *Statement + func (g *Group) Byte() *Statement + func (g *Group) Call(params ...Code) *Statement + func (g *Group) CallFunc(f func(*Group)) *Statement + func (g *Group) Callln(params ...Code) *Statement + func (g *Group) Cap(v Code) *Statement + func (g *Group) Case(cases ...Code) *Statement + func (g *Group) CaseFunc(f func(*Group)) *Statement + func (g *Group) Caseln(cases ...Code) *Statement + func (g *Group) Chan() *Statement + func (g *Group) Close(c Code) *Statement + func (g *Group) Comment(str string) *Statement + func (g *Group) Commentf(format string, a ...interface{}) *Statement + func (g *Group) Complex(r Code, i Code) *Statement + func (g *Group) Complex128() *Statement + func (g *Group) Complex64() *Statement + func (g *Group) Const() *Statement + func (g *Group) Continue() *Statement + func (g *Group) Copy(dst Code, src Code) *Statement + func (g *Group) Custom(options Options, statements ...Code) *Statement + func (g *Group) CustomFunc(options Options, f func(*Group)) *Statement + func (g *Group) Default() *Statement + func (g *Group) Defer() *Statement + func (g *Group) Defs(definitions ...Code) *Statement + func (g *Group) DefsFunc(f func(*Group)) *Statement + func (g *Group) Delete(m Code, key Code) *Statement + func (g *Group) Do(f func(*Statement)) *Statement + func (g *Group) DoesNotEqual() *Statement + func (g *Group) Dot(name string) *Statement + func (g *Group) Dotf(name string, args ...interface{}) *Statement + func (g *Group) Dotln(name string) *Statement + func (g *Group) Else() *Statement + func (g *Group) Empty() *Statement + func (g *Group) EmptyString() *Statement + func (g *Group) Equals() *Statement + func (g *Group) Err() *Statement + func (g *Group) Error() *Statement + func (g *Group) Fallthrough() *Statement + func (g *Group) False() *Statement + func (g *Group) Float32() *Statement + func (g *Group) Float64() *Statement + func (g *Group) For(conditions ...Code) *Statement + func (g *Group) ForFunc(f func(*Group)) *Statement + func (g *Group) Func() *Statement + func (g *Group) Go() *Statement + func (g *Group) GoString() string + func (g *Group) Goto() *Statement + func (g *Group) GreaterThan() *Statement + func (g *Group) GreaterThanOrEqual() *Statement + func (g *Group) ID(name string) *Statement + func (g *Group) IDf(name string, args ...interface{}) *Statement + func (g *Group) If(conditions ...Code) *Statement + func (g *Group) IfFunc(f func(*Group)) *Statement + func (g *Group) Imag(c Code) *Statement + func (g *Group) ImportBlock(values ...Code) *Statement + func (g *Group) Index(items ...Code) *Statement + func (g *Group) IndexFunc(f func(*Group)) *Statement + func (g *Group) Int() *Statement + func (g *Group) Int16() *Statement + func (g *Group) Int32() *Statement + func (g *Group) Int64() *Statement + func (g *Group) Int8() *Statement + func (g *Group) Interface(methods ...Code) *Statement + func (g *Group) InterfaceFunc(f func(*Group)) *Statement + func (g *Group) Iota() *Statement + func (g *Group) IsEqualTo() *Statement + func (g *Group) LeftShift() *Statement + func (g *Group) Len(v Code) *Statement + func (g *Group) LessThan() *Statement + func (g *Group) LessThanOrEqual() *Statement + func (g *Group) Line() *Statement + func (g *Group) List(items ...Code) *Statement + func (g *Group) ListFunc(f func(*Group)) *Statement + func (g *Group) Listln(items ...Code) *Statement + func (g *Group) Lit(v interface{}) *Statement + func (g *Group) LitByte(v byte) *Statement + func (g *Group) LitByteFunc(f func() byte) *Statement + func (g *Group) LitFunc(f func() interface{}) *Statement + func (g *Group) LitRune(v rune) *Statement + func (g *Group) LitRuneFunc(f func() rune) *Statement + func (g *Group) Litf(format string, args ...interface{}) *Statement + func (g *Group) Make(args ...Code) *Statement + func (g *Group) Map(typ Code) *Statement + func (g *Group) MapAssign() *Statement + func (g *Group) Minus() *Statement + func (g *Group) New(typ Code) *Statement + func (g *Group) Nil() *Statement + func (g *Group) Not() *Statement + func (g *Group) Null() *Statement + func (g *Group) One() *Statement + func (g *Group) Op(op string) *Statement + func (g *Group) Opln(op string) *Statement + func (g *Group) Or() *Statement + func (g *Group) PairedCallln(params ...Code) *Statement + func (g *Group) Panic(v Code) *Statement + func (g *Group) Params(params ...Code) *Statement + func (g *Group) ParamsFunc(f func(*Group)) *Statement + func (g *Group) Paramsln(params ...Code) *Statement + func (g *Group) Parens(item Code) *Statement + func (g *Group) Plus() *Statement + func (g *Group) PlusEquals() *Statement + func (g *Group) PointerTo() *Statement + func (g *Group) Print(args ...Code) *Statement + func (g *Group) PrintFunc(f func(*Group)) *Statement + func (g *Group) Println(args ...Code) *Statement + func (g *Group) PrintlnFunc(f func(*Group)) *Statement + func (g *Group) Qual(path, name string) *Statement + func (g *Group) Range() *Statement + func (g *Group) RawString(v string) *Statement + func (g *Group) RawStringf(msg string, args ...interface{}) *Statement + func (g *Group) Real(c Code) *Statement + func (g *Group) ReceiveFromChannel() *Statement + func (g *Group) Receiver(receiver Code) *Statement + func (g *Group) Recover() *Statement + func (g *Group) Render(writer io.Writer) error + func (g *Group) RenderWithFile(writer io.Writer, file *File) error + func (g *Group) Return(results ...Code) *Statement + func (g *Group) ReturnFunc(f func(*Group)) *Statement + func (g *Group) ReturnParams(params ...Code) *Statement + func (g *Group) RightShift() *Statement + func (g *Group) Rune() *Statement + func (g *Group) Select() *Statement + func (g *Group) SingleLineBlock(statements ...Code) *Statement + func (g *Group) Slice(items ...Code) *Statement + func (g *Group) Spread() *Statement + func (g *Group) String() *Statement + func (g *Group) Struct(fields ...Code) *Statement + func (g *Group) StructFunc(f func(*Group)) *Statement + func (g *Group) Switch(conditions ...Code) *Statement + func (g *Group) SwitchFunc(f func(*Group)) *Statement + func (g *Group) Tag(items map[string]string) *Statement + func (g *Group) Times() *Statement + func (g *Group) True() *Statement + func (g *Group) Type() *Statement + func (g *Group) Uint() *Statement + func (g *Group) Uint16() *Statement + func (g *Group) Uint32() *Statement + func (g *Group) Uint64() *Statement + func (g *Group) Uint8() *Statement + func (g *Group) Uintptr() *Statement + func (g *Group) Underscore() *Statement + func (g *Group) Values(values ...Code) *Statement + func (g *Group) ValuesFunc(f func(*Group)) *Statement + func (g *Group) Valuesln(values ...Code) *Statement + func (g *Group) Var() *Statement + func (g *Group) Zero() *Statement + type Options struct + Close string + Multi bool + Open string + Separator string + type Statement []Code + func Add(code ...Code) *Statement + func AddressOf() *Statement + func And() *Statement + func Append(args ...Code) *Statement + func AppendFunc(f func(*Group)) *Statement + func Assert(typ Code) *Statement + func Assign() *Statement + func BitwiseOR() *Statement + func BitwiseXOR() *Statement + func BlockFunc(f func(*Group)) *Statement + func Body(statements ...Code) *Statement + func Bool() *Statement + func Break() *Statement + func Byte() *Statement + func Call(params ...Code) *Statement + func CallFunc(f func(*Group)) *Statement + func Callln(params ...Code) *Statement + func Cap(v Code) *Statement + func Case(cases ...Code) *Statement + func CaseFunc(f func(*Group)) *Statement + func Caseln(cases ...Code) *Statement + func Chan() *Statement + func Close(c Code) *Statement + func Comment(str string) *Statement + func Commentf(format string, a ...interface{}) *Statement + func Complex(r Code, i Code) *Statement + func Complex128() *Statement + func Complex64() *Statement + func Const() *Statement + func Continue() *Statement + func Copy(dst Code, src Code) *Statement + func Custom(options Options, statements ...Code) *Statement + func CustomFunc(options Options, f func(*Group)) *Statement + func Default() *Statement + func Defer() *Statement + func Defs(definitions ...Code) *Statement + func DefsFunc(f func(*Group)) *Statement + func Delete(m Code, key Code) *Statement + func Do(f func(*Statement)) *Statement + func DoesNotEqual() *Statement + func Dot(name string) *Statement + func Dotf(name string, args ...interface{}) *Statement + func Dotln(name string) *Statement + func Else() *Statement + func Empty() *Statement + func EmptyString() *Statement + func Equals() *Statement + func Err() *Statement + func Error() *Statement + func Fallthrough() *Statement + func False() *Statement + func Float32() *Statement + func Float64() *Statement + func For(conditions ...Code) *Statement + func ForFunc(f func(*Group)) *Statement + func Func() *Statement + func Go() *Statement + func Goto() *Statement + func GreaterThan() *Statement + func GreaterThanOrEqual() *Statement + func ID(name string) *Statement + func IDf(name string, args ...interface{}) *Statement + func If(conditions ...Code) *Statement + func IfFunc(f func(*Group)) *Statement + func Imag(c Code) *Statement + func ImportBlock(values ...Code) *Statement + func Index(items ...Code) *Statement + func IndexFunc(f func(*Group)) *Statement + func Int() *Statement + func Int16() *Statement + func Int32() *Statement + func Int64() *Statement + func Int8() *Statement + func Interface(methods ...Code) *Statement + func InterfaceFunc(f func(*Group)) *Statement + func Iota() *Statement + func IsEqualTo() *Statement + func LeftShift() *Statement + func Len(v Code) *Statement + func LessThan() *Statement + func LessThanOrEqual() *Statement + func Line() *Statement + func List(items ...Code) *Statement + func ListFunc(f func(*Group)) *Statement + func Listln(items ...Code) *Statement + func Lit(v interface{}) *Statement + func LitByte(v byte) *Statement + func LitByteFunc(f func() byte) *Statement + func LitFunc(f func() interface{}) *Statement + func LitRune(v rune) *Statement + func LitRuneFunc(f func() rune) *Statement + func Litf(format string, args ...interface{}) *Statement + func Make(args ...Code) *Statement + func Map(typ Code) *Statement + func MapAssign() *Statement + func Minus() *Statement + func New(typ Code) *Statement + func Nil() *Statement + func Not() *Statement + func Null() *Statement + func One() *Statement + func Op(op string) *Statement + func Opln(op string) *Statement + func Or() *Statement + func PairedCallln(params ...Code) *Statement + func Panic(v Code) *Statement + func Params(params ...Code) *Statement + func ParamsFunc(f func(*Group)) *Statement + func Paramsln(params ...Code) *Statement + func Parens(item Code) *Statement + func Plus() *Statement + func PlusEquals() *Statement + func PointerTo() *Statement + func Print(args ...Code) *Statement + func PrintFunc(f func(*Group)) *Statement + func Println(args ...Code) *Statement + func PrintlnFunc(f func(*Group)) *Statement + func Qual(path, name string) *Statement + func Range() *Statement + func RawString(v string) *Statement + func RawStringf(msg string, args ...interface{}) *Statement + func Real(c Code) *Statement + func ReceiveFromChannel() *Statement + func Receiver(receiver Code) *Statement + func Recover() *Statement + func Return(results ...Code) *Statement + func ReturnFunc(f func(*Group)) *Statement + func ReturnParams(params ...Code) *Statement + func RightShift() *Statement + func Rune() *Statement + func Select() *Statement + func SingleLineBlock(statements ...Code) *Statement + func Slice(items ...Code) *Statement + func Spread() *Statement + func String() *Statement + func Struct(fields ...Code) *Statement + func StructFunc(f func(*Group)) *Statement + func Switch(conditions ...Code) *Statement + func SwitchFunc(f func(*Group)) *Statement + func Tag(items map[string]string) *Statement + func Times() *Statement + func True() *Statement + func Type() *Statement + func Uint() *Statement + func Uint16() *Statement + func Uint32() *Statement + func Uint64() *Statement + func Uint8() *Statement + func Uintptr() *Statement + func Underscore() *Statement + func Values(values ...Code) *Statement + func ValuesFunc(f func(*Group)) *Statement + func Valuesln(values ...Code) *Statement + func Var() *Statement + func Zero() *Statement + func (s *Statement) Add(code ...Code) *Statement + func (s *Statement) AddressOf() *Statement + func (s *Statement) And() *Statement + func (s *Statement) Append(args ...Code) *Statement + func (s *Statement) AppendFunc(f func(*Group)) *Statement + func (s *Statement) Assert(typ Code) *Statement + func (s *Statement) Assign() *Statement + func (s *Statement) BitwiseOR() *Statement + func (s *Statement) BitwiseXOR() *Statement + func (s *Statement) BlockFunc(f func(*Group)) *Statement + func (s *Statement) Body(statements ...Code) *Statement + func (s *Statement) Bool() *Statement + func (s *Statement) Break() *Statement + func (s *Statement) Byte() *Statement + func (s *Statement) Call(params ...Code) *Statement + func (s *Statement) CallFunc(f func(*Group)) *Statement + func (s *Statement) Callln(params ...Code) *Statement + func (s *Statement) Cap(v Code) *Statement + func (s *Statement) Case(cases ...Code) *Statement + func (s *Statement) CaseFunc(f func(*Group)) *Statement + func (s *Statement) Caseln(cases ...Code) *Statement + func (s *Statement) Chan() *Statement + func (s *Statement) Clone() *Statement + func (s *Statement) Close(c Code) *Statement + func (s *Statement) Comment(str string) *Statement + func (s *Statement) Commentf(format string, a ...interface{}) *Statement + func (s *Statement) Complex(r Code, i Code) *Statement + func (s *Statement) Complex128() *Statement + func (s *Statement) Complex64() *Statement + func (s *Statement) Const() *Statement + func (s *Statement) Continue() *Statement + func (s *Statement) Copy(dst Code, src Code) *Statement + func (s *Statement) Custom(options Options, statements ...Code) *Statement + func (s *Statement) CustomFunc(options Options, f func(*Group)) *Statement + func (s *Statement) Default() *Statement + func (s *Statement) Defer() *Statement + func (s *Statement) Defs(definitions ...Code) *Statement + func (s *Statement) DefsFunc(f func(*Group)) *Statement + func (s *Statement) Delete(m Code, key Code) *Statement + func (s *Statement) Do(f func(*Statement)) *Statement + func (s *Statement) DoesNotEqual() *Statement + func (s *Statement) Dot(name string) *Statement + func (s *Statement) Dotf(name string, args ...interface{}) *Statement + func (s *Statement) Dotln(name string) *Statement + func (s *Statement) Else() *Statement + func (s *Statement) Empty() *Statement + func (s *Statement) EmptyString() *Statement + func (s *Statement) Equals() *Statement + func (s *Statement) Err() *Statement + func (s *Statement) Error() *Statement + func (s *Statement) Fallthrough() *Statement + func (s *Statement) False() *Statement + func (s *Statement) Float32() *Statement + func (s *Statement) Float64() *Statement + func (s *Statement) For(conditions ...Code) *Statement + func (s *Statement) ForFunc(f func(*Group)) *Statement + func (s *Statement) Func() *Statement + func (s *Statement) Go() *Statement + func (s *Statement) GoString() string + func (s *Statement) Goto() *Statement + func (s *Statement) GreaterThan() *Statement + func (s *Statement) GreaterThanOrEqual() *Statement + func (s *Statement) ID(name string) *Statement + func (s *Statement) IDf(name string, args ...interface{}) *Statement + func (s *Statement) If(conditions ...Code) *Statement + func (s *Statement) IfFunc(f func(*Group)) *Statement + func (s *Statement) Imag(c Code) *Statement + func (s *Statement) ImportBlock(values ...Code) *Statement + func (s *Statement) Index(items ...Code) *Statement + func (s *Statement) IndexFunc(f func(*Group)) *Statement + func (s *Statement) Int() *Statement + func (s *Statement) Int16() *Statement + func (s *Statement) Int32() *Statement + func (s *Statement) Int64() *Statement + func (s *Statement) Int8() *Statement + func (s *Statement) Interface(methods ...Code) *Statement + func (s *Statement) InterfaceFunc(f func(*Group)) *Statement + func (s *Statement) Iota() *Statement + func (s *Statement) IsEqualTo() *Statement + func (s *Statement) LeftShift() *Statement + func (s *Statement) Len(v Code) *Statement + func (s *Statement) LessThan() *Statement + func (s *Statement) LessThanOrEqual() *Statement + func (s *Statement) Line() *Statement + func (s *Statement) List(items ...Code) *Statement + func (s *Statement) ListFunc(f func(*Group)) *Statement + func (s *Statement) Listln(items ...Code) *Statement + func (s *Statement) Lit(v interface{}) *Statement + func (s *Statement) LitByte(v byte) *Statement + func (s *Statement) LitByteFunc(f func() byte) *Statement + func (s *Statement) LitFunc(f func() interface{}) *Statement + func (s *Statement) LitRune(v rune) *Statement + func (s *Statement) LitRuneFunc(f func() rune) *Statement + func (s *Statement) Litf(format string, args ...interface{}) *Statement + func (s *Statement) Make(args ...Code) *Statement + func (s *Statement) Map(typ Code) *Statement + func (s *Statement) MapAssign() *Statement + func (s *Statement) Minus() *Statement + func (s *Statement) New(typ Code) *Statement + func (s *Statement) Nil() *Statement + func (s *Statement) Not() *Statement + func (s *Statement) Null() *Statement + func (s *Statement) One() *Statement + func (s *Statement) Op(op string) *Statement + func (s *Statement) Opln(op string) *Statement + func (s *Statement) Or() *Statement + func (s *Statement) PairedCallln(params ...Code) *Statement + func (s *Statement) Panic(v Code) *Statement + func (s *Statement) Params(params ...Code) *Statement + func (s *Statement) ParamsFunc(f func(*Group)) *Statement + func (s *Statement) Paramsln(params ...Code) *Statement + func (s *Statement) Parens(item Code) *Statement + func (s *Statement) Plus() *Statement + func (s *Statement) PlusEquals() *Statement + func (s *Statement) PointerTo() *Statement + func (s *Statement) Print(args ...Code) *Statement + func (s *Statement) PrintFunc(f func(*Group)) *Statement + func (s *Statement) Println(args ...Code) *Statement + func (s *Statement) PrintlnFunc(f func(*Group)) *Statement + func (s *Statement) Qual(path, name string) *Statement + func (s *Statement) Range() *Statement + func (s *Statement) RawString(v string) *Statement + func (s *Statement) RawStringf(msg string, args ...interface{}) *Statement + func (s *Statement) Real(c Code) *Statement + func (s *Statement) ReceiveFromChannel() *Statement + func (s *Statement) Receiver(receiver Code) *Statement + func (s *Statement) Recover() *Statement + func (s *Statement) Render(writer io.Writer) error + func (s *Statement) RenderWithFile(writer io.Writer, file *File) error + func (s *Statement) Return(results ...Code) *Statement + func (s *Statement) ReturnFunc(f func(*Group)) *Statement + func (s *Statement) ReturnParams(params ...Code) *Statement + func (s *Statement) RightShift() *Statement + func (s *Statement) Rune() *Statement + func (s *Statement) Select() *Statement + func (s *Statement) SingleLineBlock(statements ...Code) *Statement + func (s *Statement) Slice(items ...Code) *Statement + func (s *Statement) Spread() *Statement + func (s *Statement) String() *Statement + func (s *Statement) Struct(fields ...Code) *Statement + func (s *Statement) StructFunc(f func(*Group)) *Statement + func (s *Statement) Switch(conditions ...Code) *Statement + func (s *Statement) SwitchFunc(f func(*Group)) *Statement + func (s *Statement) Tag(items map[string]string) *Statement + func (s *Statement) Times() *Statement + func (s *Statement) True() *Statement + func (s *Statement) Type() *Statement + func (s *Statement) Uint() *Statement + func (s *Statement) Uint16() *Statement + func (s *Statement) Uint32() *Statement + func (s *Statement) Uint64() *Statement + func (s *Statement) Uint8() *Statement + func (s *Statement) Uintptr() *Statement + func (s *Statement) Underscore() *Statement + func (s *Statement) Values(values ...Code) *Statement + func (s *Statement) ValuesFunc(f func(*Group)) *Statement + func (s *Statement) Valuesln(values ...Code) *Statement + func (s *Statement) Var() *Statement + func (s *Statement) Zero() *Statement