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

Add functions to make certain assertions #18

Merged
merged 2 commits into from Nov 28, 2018
Merged

Conversation

yorinasub17
Copy link
Contributor

Copy link
Member

@brikis98 brikis98 left a comment

Choose a reason for hiding this comment

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

Good addition 👍

func EnvironmentVarRequiredE(varName string) (string, error) {
value := os.Getenv(varName)
if value == "" {
return "", fmt.Errorf("The environment variable %s is required to be set", varName)
Copy link
Member

Choose a reason for hiding this comment

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

Create a custom type of errors. It makes it easier to check for errors and write tests against them.

@yorinasub17
Copy link
Contributor Author

Ok merging. Will release this with the other 2.

@yorinasub17 yorinasub17 merged commit bce40c5 into master Nov 28, 2018
@yorinasub17 yorinasub17 deleted the yori-assertions branch November 28, 2018 22:52
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