Skip to content
Advertisement

Tag: go

“sql: no rows in result set”

I am handling user auth data posted to my Go backend through an HTML form. I am building on some boilerplate to learn Go better. My problem is what the following func returns: func (ctrl …

Making dynamic SQL queries to a MySQL DB

I’ve never used golang with mysql before, so I’m reading about these for the first time. I’d like to do something like this: This is far too much typing, especially if I have a dozen more variables I’d like to add to the WHERE condition. If this were PHP, I’d do something like this: By using a foreach loop, I

Checking if a value exists in sqlite db with Go

I’m writing code to manage users in a sqlite database with Go. I’m trying to check if a username is taken, but my code is ugly. My table looks like: And I check if a username is taken with: Is there a better query I could use that would tell me if the username value exists in the table in

Advertisement