Documentation ¶
Index ¶
- Variables
- func SameType(t, t2 Type) bool
- func TypeIs(t Type, s string) bool
- type Array
- type Chan
- type ChanDir
- type File
- type Func
- type FuncDecl
- type FuncParam
- type FuncResult
- type Ident
- type ImportDecl
- type Info
- type Interface
- type InterfaceMethod
- type Map
- type Pointer
- type Position
- type Selector
- type Slice
- type Struct
- type StructField
- type Type
- type TypeDecl
Constants ¶
This section is empty.
Variables ¶
View Source
var ( String = Ident("string") Bool = Ident("bool") Byte = Ident("byte") Rune = Ident("rune") Uintptr = Ident("uintptr") Int = Ident("int") Int8 = Ident("int8") Int16 = Ident("int16") Int32 = Ident("int32") Int64 = Ident("int64") Uint = Ident("uint") Uint8 = Ident("uint8") Uint16 = Ident("uint16") Uint32 = Ident("uint32") Uint64 = Ident("uint64") Float32 = Ident("float32") Float64 = Ident("float64") Complex64 = Ident("complex64") Complex128 = Ident("complex128") EmptyStruct = Struct{} Bytes = Slice{Elem: Byte} Error = Ident("error") )
Functions ¶
Types ¶
type File ¶
type File struct { Path string // The path of the Go file this File represents. Imports []ImportDecl // The imports contained within the Go file. Types []TypeDecl // The Type declarations contained within the Go file. Funcs []FuncDecl // The Function declarations contained within the Go file. HasErrors bool // HasErrors is true if there was an invalid declaration was found. }
File contains all the information we have about a parsed Go file.
func NewFile ¶
NewFile parses a Go file. If reader is nil, the file at path is opened. Otherwise, reader is taken to be the contents of the file.
func (*File) GetMethods ¶
GetMethods fetches the methods belonging to the given type identifier.
type Func ¶
type Func struct { Params []FuncParam Results []FuncResult }
type FuncResult ¶
func (FuncResult) String ¶
func (f FuncResult) String() string
type ImportDecl ¶
type Info ¶
type Info struct { Arch string OS string Package string File string Line int // contains filtered or unexported fields }
Info contains the information about a go generate call.
func Generate ¶
Generate returns the information about the current go generate call. It will return an error if this execution was not apparently initiated by go generate.
type Interface ¶
type Interface struct {
Methods []InterfaceMethod
}
type InterfaceMethod ¶
func (InterfaceMethod) String ¶
func (f InterfaceMethod) String() string
type Struct ¶
type Struct struct {
Fields []StructField
}
type StructField ¶
func (StructField) String ¶
func (f StructField) String() string
type Type ¶
type Type interface { String() string // contains filtered or unexported methods }
Type is one of the following concrete types: Ident, Pointer, Slice, Array, Map, Struct, Chan, Func, Interface, Selector
Click to show internal directories.
Click to hide internal directories.