deepcopy

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jan 19, 2024 License: BSD-3-Clause Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Tag             = "deepcopy"
	Cloneable       = "@copyable"     // 标记要不要实现Copy
	PtrRecv         = "@ptrrecv"      // 标记是否是指针接受
	ExportedOnly    = "@exportedonly" // 标记是否只导出
	Name            = "@name"         // 标记函数名称
	DefaultFuncName = "DeepCopy"      // 默认函数名称
)

Variables

This section is empty.

Functions

func In

func In(list []string, v string) bool

func ParseGeneratorOptions

func ParseGeneratorOptions(p *packages.Package) [][]GeneratorOption

ParseGeneratorOptions 从包中解析生成器选项

Types

type Generator

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

func NewGenerator

func NewGenerator(buildTags []string, names []string) Generator

func (Generator) Generate

func (g Generator) Generate(out io.Writer, p *packages.Package, group []GeneratorOption, all [][]GeneratorOption) error

type GeneratorOption

type GeneratorOption struct {
	Option
}

GeneratorOption 包含了生成器选项的切片

type Option

type Option struct {
	Name         string
	FuncName     string
	Generate     bool
	PtrRecv      bool
	Object       object
	ExportedOnly bool
}

Option 包含了生成器选项的结构体

Jump to

Keyboard shortcuts

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