INNER CODE UNIT · Go

copier

jinzhu/copier · copier.go:128

func copier(toValue interface{}, fromValue interface{}, opt Option) (err error) {
	var (
		isSlice    bool
		amount     = 1
		from       = indirect(reflect.ValueOf(fromValue))
		to         = indirect(reflect.ValueOf(toValue))
		converters = opt.converters()
		mappings   = opt.fieldNameMapping()
	)

	if !to.CanAddr() {
		return ErrInvalidCopyDestination
	}

	// Return is from value is invalid
	if !from.IsValid() {
		return ErrInvalidCopyFrom
	}

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…