globusdigital / deep-copy

Deep copy generator
BSD 3-Clause "New" or "Revised" License
150 stars 34 forks source link

Fix hasDeepCopy to use values of --pointer-receiver option #16

Closed egawata closed 3 years ago

egawata commented 3 years ago

Fixed #15

The reason of the problem seems to be the function hasDeepCopy(), which receives pointer as an argument and returns it to caller reuseDeepCopy() as isPointer when a target object is found in generated. However, at that time, the isPointer should be determined by whether DeepCopy() of the object returns pointer value or non-pointer value, which depends on an option --pointer-receiver.

I fixed the problem by passing pointerReceiverF to hasDeepCopy().

codecov[bot] commented 3 years ago

Codecov Report

Merging #16 (02bcfef) into master (bfdfaf5) will not change coverage. The diff coverage is 100.00%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master      #16   +/-   ##
=======================================
  Coverage   68.49%   68.49%           
=======================================
  Files           1        1           
  Lines         273      273           
=======================================
  Hits          187      187           
  Misses         70       70           
  Partials       16       16           
Impacted Files Coverage Δ
main.go 68.49% <100.00%> (ø)