-
Notifications
You must be signed in to change notification settings - Fork 1k
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
client: Make example testable #987
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.
rest lgtm
Oh you mean the the purpose of |
Hi, do you need some help on this PR? |
Still not 100% sure what the best way is. But I'm getting more sure that testable examples are the right choice. |
Signed-off-by: lance6716 <lance6716@gmail.com>
I have added my commit, PTAL @dveeden |
This removes the client example from the README and puts it in its own file.
The benefits of this:
The drawbacks of this:
Issues found with the example while doing this:
github.com/go-mysql-org/go-mysql/mysql
(it usesmysql.FieldValueTypeFloat
)table
, which is confusing.defer r.Close()
should probably be moved higher upr.GetInt()
andr.GetIntByName()
probably need more explanationr
variable is created twice with:=
Setting this as draft as I'm not sure if this is the right thing to do or not.