Skip to content
New issue

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

defaultCurrency implemented for unknown input currencies + ChangeDefaultCur… #79

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

aliash98
Copy link

@aliash98 aliash98 commented Feb 5, 2021

…rency(), issue #69

Copy link
Contributor

@totemcaf totemcaf left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice work, but I'm still better having no default and fail if currency is missing.

@@ -211,6 +214,14 @@ func GetCurrency(code string) *Currency {
return currencies[code]
}

// ChangeDefaultCurrency changes the default currency
func ChangeDefaultCurrency(code string) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What do you think on reporting an error if currency does not exists?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we handle currency names as case insensitive?

}

func TestCurrency_Get2(t *testing.T) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can change the test name to something more semantic on the test goal?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants