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
Added pubkey support to e4client #24
Conversation
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.
Thank you for this change @daeMOn63!
A couple of comments:
a) Let's refactor out the repetitive fmt.Print.. and os.Exit(1) into a helper utility logAndExit
that looks like this
func logAndExit(fmtStr string, args ...interface{}) {
fmt.Printf(fmtStr, ...args)
os.Exit(1)
}
b) Replace os.Open, defer (*os.File).Close, ioutil.ReadAll with ioutil.ReadFile
@odeke-em instead of |
WIP added - we can hold on pubkey support for after the first release |
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.
Just one thing to look at them LGTM.
l.Printf("failed to generate key: %v", err) | ||
return | ||
} | ||
l.Printf("public key: %x", key.Public()) |
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.
This code will unconditionally print "public key" and is going to crash if err != nil and key == nil.
You need to add a return on line 183.
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.
thanks!
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.
LGTM and thank you @daeMOn63!
No description provided.