diff options
author | Olivier Mengué <dolmen@cpan.org> | 2017-11-17 12:56:58 +0100 |
---|---|---|
committer | Olivier Mengué <dolmen@cpan.org> | 2018-06-14 17:54:31 +0200 |
commit | 4a1b4064568189d6f819f5fe19ff9bf6d6e8de95 (patch) | |
tree | bfb04fe1249c52198d19b4c8f5ca6788730326eb /excelize_test.go | |
parent | 9e463b4614348b3ddc04b1fedd5d662845ce0fb9 (diff) |
CopySheet() using reflect instead of encoding/gob
Use github.com/mohae/deepcopy to deep copy worksheets instead of the
internal deepcopy function that was using encoding/gob serialization and
deserialization.
Rationale:
1/ using `encoding/gob` is much slower than
[`mohae/deepcopy`](https://github.com/mohae/deepcopy/)
2/ When building an application this implementation of `deepcopy` drags
the `encoding/gob` package into the binary. And this package is much
bigger than `mohae/deepcopy` (which only depends on `time` and `reflect`).
```
$ LC_ALL=C stat -f "%6z %N" $(go env GOPATH)/pkg/$(go env GOOS)_$(go env GOARCH)/github.com/mohae/deepcopy.a $(go env GOROOT)/pkg/$(go env GOOS)_$(go env GOARCH)/encoding/gob.a
10508 .../pkg/darwin_amd64/github.com/mohae/deepcopy.a
541818 .../pkg/darwin_amd64/encoding/gob.a
```
Diffstat (limited to 'excelize_test.go')
-rw-r--r-- | excelize_test.go | 1 |
1 files changed, 0 insertions, 1 deletions
diff --git a/excelize_test.go b/excelize_test.go index 4dbc709..aca33b4 100644 --- a/excelize_test.go +++ b/excelize_test.go @@ -88,7 +88,6 @@ func TestOpenFile(t *testing.T) { xlsx.SetCellValue("Sheet2", "F16", true) xlsx.SetCellValue("Sheet2", "F17", complex64(5+10i)) t.Log(letterOnlyMapF('x')) - t.Log(deepCopy(nil, nil)) shiftJulianToNoon(1, -0.6) timeFromExcelTime(61, true) timeFromExcelTime(62, true) |