fix
This commit is contained in:
@@ -1,9 +1,27 @@
|
||||
package copier
|
||||
|
||||
import "errors"
|
||||
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")
|
||||
ErrNotSupported = errors.New("not supported")
|
||||
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}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user