Golang code where API call for getting user details from db using user_id
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")
}
}