package copier import ( "errors" "fmt" "reflect" ) var ( ErrInvalidCopyDestination = errors.New("copy destination must be non-nil and addressable") ErrInvalidCopyFrom = errors.New("copy from must be non-nil and addressable") ErrCircularReference = errors.New("circular reference detected") ErrMaxDepthExceeded = errors.New("max depth exceeded") ) type NotSupportedError struct { SrcType reflect.Type DstType reflect.Type } func (e *NotSupportedError) Error() string { return fmt.Sprintf("unsupported type conversion from %s to %s", e.SrcType, e.DstType) } func ErrNotSupported(srcType, dstType reflect.Type) error { return &NotSupportedError{SrcType: srcType, DstType: dstType} }