Documentation ¶
Index ¶
Constants ¶
View Source
const ( DirectivePrefix = "cloner:" DirectiveCommentIgnore = "ignore" DirectiveCommentCopyPtr = "copyptr" DirectiveCommentMake = "make" )
Variables ¶
View Source
var (
ErrUnknownDirective = errors.New("unknown directive")
)
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { MatcherConfig *MatcherConfig Logger *slog.Logger }
type CopyHandle ¶
type CopyHandle int
const ( // ignore nocopy object CopyHandleIgnore CopyHandle = 0 // disallow nocopy object CopyHandleDisallow CopyHandle = 1 << iota CopyHandleCopyPointer // Only for channel. make a new channel. CopyHandleMake )
type CustomHandler ¶
type CustomHandler struct { Matcher func(types.Type) bool Imports []imports.TargetImport Expr func(CustomHandlerExprData) (expr func(s string) (expr string), isFunc bool) }
type CustomHandlerExprData ¶
type CustomHandlers ¶
type CustomHandlers []CustomHandler
func (CustomHandlers) Imports ¶
func (h CustomHandlers) Imports() []imports.TargetImport
type MatcherConfig ¶
type MatcherConfig struct { NoCopyHandle CopyHandle ChannelHandle CopyHandle FuncHandle CopyHandle CustomHandlers CustomHandlers // contains filtered or unexported fields }
Click to show internal directories.
Click to hide internal directories.