diff --git a/examples/golang-api-with-postgres-and-sqlc/repository/repository.go b/examples/golang-api-with-postgres-and-sqlc/repository/repository.go index 32c64c9..18ff91e 100644 --- a/examples/golang-api-with-postgres-and-sqlc/repository/repository.go +++ b/examples/golang-api-with-postgres-and-sqlc/repository/repository.go @@ -76,11 +76,5 @@ func (r *UserRepository) ListUsers(ctx context.Context) ([]model.User, error) { } func NewText(s string) pgtype.Text { - if s == "" { - return pgtype.Text{} - } - return pgtype.Text{ - String: s, - Valid: true, - } + return pgtype.Text{String: s, Valid: s != ""} }