1 Answers

You might want to check the err after your SQL SELECT statement for an error of type sql.ErrNoRows, e.g.

if err != nil {
   if err == sql.ErrNoRows {
       fmt.Fprintf(w, "User ID not found in DB") 
     } else { 
       fmt.Fprintf(w, "Handle others possible DB errors")
     } 
}
Related