Remove jsonData argument from image.StoreImage#8799
Conversation
|
hey @crosbymichael, @tiborvass, @vieux, @jfrazelle, et al, please review :D |
|
ping @unclejack |
|
I was running the tests. LGTM |
|
oh! I didn't realize you were looking at this already. Thank you 👍 |
|
You have ESP, LGTM |
|
LGTM |
|
ping @tiborvass @crosbymichael I think we need one more LGTM from a maintainer to put this over the edge. 👍 ? |
There was a problem hiding this comment.
@jlhawn It'd be a little more efficient to use f, err := os.Create(jsonPath(root)) and then use a json.NewEncoder to write to f.
There was a problem hiding this comment.
@jlhawn If you think this is out of scope, I understand, so just let me know :)
There was a problem hiding this comment.
Sure. I've been doing that with other/new things I've been writing anyway. Must avoid unnecessary allocations >_>
There was a problem hiding this comment.
OK, @tiborvass I've updated the PR. Might want to wait for Drone.io to come back green. jlhawn@8e9627a#diff-da07f373046a0a24e67b18699dc15a70R93
e540d43 to
8e9627a
Compare
There was a problem hiding this comment.
@jlhawn why not return encoder.Encode(img) ? :)
There was a problem hiding this comment.
sorry, didn't look that far ahead actually. Updated with return json.NewEncoder(f).Encode(img) because why not...
8e9627a to
e1bd487
Compare
The argument specified the json data to save to disk when registering a new image into the image graph. If it is nil, then the given image is serialized to json and that is written by default. This default behavior is sufficient if the given image was originally deserialzed from this jsonData to begin with which has always been the case. Signed-off-by: Josh Hawn <[email protected]> (github: jlhawn)
e1bd487 to
26184de
Compare
|
LGTM (but will wait for drone) |
Remove `jsonData` argument from `image.StoreImage`
The argument specified the json data to save to disk when registering
a new image into the image graph. If it is nil, then the given image
is serialized to json and that is written by default. This default
behavior is sufficient if the given image was originally deserialzed
from this jsonData to begin with which has always been the case.
Signed-off-by: Josh Hawn [email protected] (github: jlhawn)