-
Notifications
You must be signed in to change notification settings - Fork 40k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Convert bool to error, helper func for cd to skew #30321
Conversation
56ffb66
to
131d83d
Compare
|
||
func doOrDie(msg string, err error) { | ||
if err != nil { | ||
log.Fatalf("error %s: %s", msg, err) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please don't do this. I know it sucks to repeat code, but please log.Fatal
where the error is received and not in a utility method like this. What you have here will always die on line 456. https://play.golang.org/p/SdbuTBrh8P
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
@krousey thanks for the comments. PTAL when you have the chance! |
A couple more minor nits. Feel free to fix and add lgtm. Reviewed 2 of 2 files at r2. hack/e2e.go, line 202 [r2] (raw file):
This assignment can be on the same line. hack/e2e.go, line 207 [r2] (raw file):
maybe a variable for this path too? Comments from Reviewable |
Thanks! Review status: 1 of 2 files reviewed at latest revision, 2 unresolved discussions. hack/e2e.go, line 202 [r2] (raw file):
|
ap := writeOrDie(location, "gcp-resources-after.txt", after) | ||
|
||
var mode os.FileMode = 0664 | ||
bp := filepath.Join(location, "gcp-resources-before.txt") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you have taken the Go unnecessarily-short-variable-name style to heart, I see. :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ack
GCE e2e build/test passed for commit fd15911. |
Adding lgtm per comments and retest-not-required as we do not use the head version of hack/e2e.go in testing. |
Automatic merge from submit-queue |
Automatic merge from submit-queue Convert bool to error, helper func for cd to skew Switch from various functions returning `False` when something bad happens to returning an `error` Encapsulate logic to switch to the skew directory inside chdirSkew Also add a TODO for using `hyphen-flags` instead of `underscore_flags`
Switch from various functions returning
False
when something bad happens to returning anerror
Encapsulate logic to switch to the skew directory inside chdirSkew
Also add a TODO for using
hyphen-flags
instead ofunderscore_flags
This change is