return attrs for newly created object in rewrite - #823
Conversation
fsouza
left a comment
There was a problem hiding this comment.
Hmm that should work yeah. Any chance we can add a test?
Thanks for contributing!
|
I just pushed a change to the existing rewrite tests to ensure that generation is not zero. I'm not sure if it's possible to predict in advance the generation. Maybe the correct test is to try fetching the version of the file with the returned generation? Let me know what you think. I verified that the updated tests fail when I revert my change. |
This looks good, can you just fix the golangci-lint failure? Thanks for contributing! |
|
Thank you! |
When using Copier.Run to copy a file the resulting attributes object had 0 for generation. This change seems to populate the generation field with the value from the created object, but I'm not certain it's actually the correct fix--maybe the other attributes should be from newObject?
Please let me know if you need more information about the issue or the change. The tests appear to be passing.