Current coverage is ~85.7%. The branches below were identified by running go test -coverprofile and inspecting uncovered statements. Each item is a distinct, reachable (or questionably reachable) code path with no test.
mergo.go — isEmptyValue
merge.go — deepMerge
Error propagation (require a transformer that returns an error)
Slice handling
Map handling
Pointer / interface handling
mergo.go — resolveValues
map.go — _map
map.go — deepMap
Defensive / likely unreachable
Current coverage is ~85.7%. The branches below were identified by running
go test -coverprofileand inspecting uncovered statements. Each item is a distinct, reachable (or questionably reachable) code path with no test.mergo.go—isEmptyValuecase reflect.Func: return v.IsNil()(line 57) — covered byTestMergeFuncFieldadded in the same scan sessioncase reflect.Ptr/Interface+shouldDereference=false→return false(line 55–56) — non-nil pointer withWithoutDereferencemerge.go—deepMergeError propagation (require a transformer that returns an error)
deepMerge(line 93)deepMerge(line 151)sliceDeepCopyloop): error fromdeepMerge(line 187)sliceDeepCopyloop): error fromdeepMerge(line 245)deepMerge(dst.Elem(), src.Elem())(line 267)Slice handling
AppendSlicetype-mismatch for top-level slices —"cannot append two slice with different type"(line 230–232); only reachable by callingdeepMergedirectly, not via the public API (which rejects mismatched types earlier inresolveValues)sliceDeepCopyfor slices stored as map values (line 174–192) — tested for struct fields but not map valuesMap handling
SetMapIndexwhen both src and dst enter as nil (line 207–209)Pointer / interface handling
dst.Elem().Type() == src.Type()branch: interface dst, non-pointer src of matching concrete type (line 275–278)ErrDifferentArgumentsTypesinside pointer/interface handling (line 279–281)reflect.Interface, non-nil, no overwrite, same element kind (line 292–296)mergo.go—resolveValuesErrNotSupported: pointer-to-primitive passed to_map(line 71–73)map.go—_mapErrNonPointerArgumentforMap()(line 144–146) — tested forMerge()but notMap()resolveValueserror in_map: nil dst or src passed toMap()(line 157–159)ErrExpectedMapAsDestination: struct src, non-map dst (e.g. a slice) (line 167–169)ErrExpectedStructAsDestination: map src, non-struct dst (e.g. a slice) (line 171–173)ErrNotSupportedin_map: src is neither struct nor map (line 174–175)map.go—deepMapchangeInitialCase(line 19–21) — no empty-string map keys in existing tests!srcElement.IsValid()for nil map values (line 98–100)dstKind == Interfacebranch (line 105–108)srcKind == MaprecursivedeepMapbranch for nested map→struct (line 109–112)deepMergein struct case (line 102–104)dstKind == Ptr && srcElement.CanAddr()(line 91–95) — likely unreachable; map values are never addressable in Go (the comment in the source says "Can this work? I guess it can't.")Defensive / likely unreachable
!srcElement.IsValid()inside map key iteration (line 120) — map keys always produce valid values!srcElement.CanInterface()for map elements (line 134) — map values are always interfaceable