-
Notifications
You must be signed in to change notification settings - Fork 48
Open
Description
If you run the example code in the Databases section as-is, the request throws a "Panic" error because QueryRow has to return a row, and the newly-initialized database table of course has no rows in it.
http://codegangsta.gitbooks.io/building-web-apps-with-go/content/databases/README.html
Again, very easy to figure out if you're not a total beginner, but maybe it would be better to either populate the db in the NewDB() function or remind the reader that the database must have data in order for QueryRow to work.
(Totally off-topic, but having worked with Perl's DBI for years I find the Golang database libraries really, really primitive. But maybe that's just me, I'm new to it...)
cheers
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels