We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
how to convert null to string .?
""
func find_a_user_with_username(db *sql.DB, username string) (models.Users, error) { if username == "" { return models.Users{}, myerror.New("invalid username is none") } var user models.Users err := db.QueryRow(` SELECT id, username, password_hash, email, token, refresh_token, created_at, updated_at FROM users WHERE username = $1 `, username).Scan( &user.Id, &user.Username, &user.PasswordHash, &user.Email, &user.Token, &user.RefreshToken, &user.CreatedAt, &user.UpdatedAt, ) if err != nil { if err == sql.ErrNoRows { return user, myerror.New("No matching rows found.") } else { return user, myerror.WrapError(err, "Error retriving row") } } return user, nil }
The text was updated successfully, but these errors were encountered:
No branches or pull requests
how to convert null to string .?
here token is null and I want it to convert it to
""
empty stringThe text was updated successfully, but these errors were encountered: