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 implementation of binary string generator for Faker #72

Merged
merged 3 commits into from
Oct 10, 2021

Conversation

bhatipradeep
Copy link
Contributor

Description

Added a binary string generator for faker.

Are you trying to fix an existing issue?

No

Go Version

$ go version
go version go1.17.1 windows/amd64

Go Tests

$ go test
PASS
ok      github.com/jaswdr/faker 12.114s

@jaswdr
Copy link
Owner

jaswdr commented Oct 10, 2021

@bhatipradeep congrats for the first contribution, can you just describe what is the use case of this generator?

@bhatipradeep
Copy link
Contributor Author

Thanks @jaswdr . The most common usecase for students is to design testcases of various competitive programming problems.

@jaswdr
Copy link
Owner

jaswdr commented Oct 10, 2021

right, please check the Codacy report, there are some violations.

binarystring.go Outdated
}

//BinaryNumberOfLength returns random binary string with given input length
func (bn BinaryString) BinaryStringOfLength(l int) string {
Copy link
Owner

Choose a reason for hiding this comment

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

Minor change, please use BinaryString.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

change function name ?

)

//check if given string is binary or not
func CheckIfBinaryString(binary_string string) bool {
Copy link
Owner

Choose a reason for hiding this comment

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

Since this function is only used in the TestBinaryStringOfLength and no other test should use it, can you move this code to the TestBinaryStringOfLength?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes. It can be shifted to test itself for now.

@bhatipradeep
Copy link
Contributor Author

@jaswdr updated code with changes.

@jaswdr jaswdr merged commit 6df012d into jaswdr:master Oct 10, 2021
@jaswdr
Copy link
Owner

jaswdr commented Oct 11, 2021

@bhatipradeep released in v1.6.0, congrats for your first merge 🎉

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.

2 participants