Closed tomclegg closed 8 years ago
Hi @tomclegg , thanks.
Is it possible to test
this change? Does it just improve performance by not copying stuff that didn't change? or there is a real zeroing
problem and cross contamination or something?
@alimoeeny it's not just a performance issue. obj
and sourceObject
are pointers, so when obj == sourceObject
, the following line replaces sourceObject.data
with a newly initialized slice:
obj.data = make([]byte, len(sourceObject.data))
Will add a test.
Without the fix, test fails like this
s3t_test.go:76:
s.clientTests.TestBasicFunctionality(c)
s3i_test.go:208:
c.Check(string(data), check.Equals, "hey!")
... obtained string = "\x00\x00\x00\x00"
... expected string = "hey!"
Thanks @tomclegg
Makes s3test do what AWS does in this situation, i.e., update LastModified but leave the data intact.