Return empty string from extractEmail on no match

Open Beginner friendly
#193 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
1/5
Estimated time
Under an hour
Newbie friendliness
92/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
go
Domain
cli

Research direction

Open discountsParser.go and locate extractEmail, then review the no_email case in discountsParser_test.go. Update the behavior and test expectation so a missing email produces an empty string, and run the relevant Go test to confirm it passes.

Written by the indexing model from the issue text.

Description

L1 recommended for recruits

Overview

In discountsParser.go, the function extractEmail returns the literal string "No email here" when no email is found. This is a sentinel value, not an email. If the caller ever stores the result in DiscountProgram.Email, the database will contain the text "No email here" as an email address. Change extractEmail to return an empty string "" when no match is found. Update the test in discountsParser_test.go for the no_email case to expect "".

Resources

Dominant language
Go
Stars
11
Forks
54
Avg merge
2d 14h
Merged PRs (30d)
2

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from UTDNebula/api-tools

All issues in UTDNebula/api-tools

Similar issues

More Go issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.