Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
-update_golden creating empty files (#277)
* confgenerator: -update_golden creating empty files `updateOrCompareGolden` did not detect the case where a diff is empty because the file doesn't exist yet. Added a check for the edge case that creates the empty golden file if it doesn't exist yet. * confgenerator: reword comment The other comments don't use self-referring words like "we". * confgenerator: combine file-writing logic branches * confgenerator: handle ErrNotExist specifically The previous implementation assumed any error occurs because the file does not exist. Instead, check that the returned error is specifically os.ErrNotExist. * confgenerator: always write file if empty To simplify the logic when detecting a golden update, treat an empty `actual` as something that always needs to be written. * confgenerator: clarify update golden condition Added clarifying to the condition that decides whether to (over)write the golden file.
- Loading branch information