writer

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Feb 23, 2023 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExistedMethodForInterface

func ExistedMethodForInterface(list *ast.FieldList, methodName string) bool

func ExistedMethodForStruct

func ExistedMethodForStruct(decls []ast.Decl, method string, receiverType string) bool

func FileInsertContent

func FileInsertContent(fileName string, line int, content string)

func GetIdent

func GetIdent(i string) ast.Expr

func WriteFile

func WriteFile(fileName string, writers []Writer)

func WriteFileForLine

func WriteFileForLine(fileName string, writers []Writer)

Types

type WriteFunc

type WriteFunc func(fset *token.FileSet, fileNode *ast.File)

func (WriteFunc) Write

func (w WriteFunc) Write(fset *token.FileSet, fileNode *ast.File)

type Writer

type Writer interface {
	Write(fset *token.FileSet, fileNode *ast.File)
}

func GetFuncWriter

func GetFuncWriter(receiverName string, receiverType string, funcName string, paramNames []string, paramTypes []string, returnTypes []string, returnDefaultValues []string) Writer

func GetImportWriter

func GetImportWriter(alia string, importValue string) Writer

func GetInterfaceWrite

func GetInterfaceWrite(interfaceName string, funcName string, paramNames []string, paramTypes []string, returnTypes []string) Writer

func GetInterfaceWrite2

func GetInterfaceWrite2(fileName string, interfaceName string, method string) Writer

GetInterfaceWrite2 dismiss the influence of the comment

Jump to

Keyboard shortcuts

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