Skip to content
This repository was archived by the owner on Mar 27, 2024. It is now read-only.

Adding size info to file diff/analysis #30

Merged
merged 4 commits into from
Aug 18, 2017

Conversation

cftorres
Copy link
Contributor

@cftorres cftorres changed the title File diff size Adding size info to file diff/analysis Aug 18, 2017
stat, err := os.Stat(path)
if err != nil {
glog.Errorf("Could not obtain size for %s: %s", path, err)
return -1
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

seems to me that if we hit an error here, we have another problem and probably want to throw some kind of error, rather than just silently returning -1 (which will just get outputted silently). WDYT?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The next thing I was working on was modifying the human-readable output, to check for any sizes that = -1 and outputting "unknown" or "error" or something under the size column instead of -1. The reason I didn't want to error out when the size of a particular file could not be found was to allow the rest of the analysis to be performed for the non-problematic files regardless of potential size retrieval errors.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok that's fine. if we start seeing errors happen there we should probably investigate the root cause, but for now this should be good.

@cftorres cftorres merged commit 1f73b93 into GoogleContainerTools:master Aug 18, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add sizes to FileDiff
2 participants