Skip to content
This repository has been archived by the owner on Dec 8, 2022. It is now read-only.

feat(faker): length Support #60

Merged
merged 10 commits into from
Feb 20, 2019
Merged

Conversation

olimpias
Copy link
Contributor

@olimpias olimpias commented Feb 10, 2019

String len, number boundaries and array and map size have become configurable. In reference task, it was asked as a tag but I think, adding two new unnecessary field will be pointless for length setting instead making configuration will be more convenient. So It has become configurable with this PR...

fix #49

@codecov
Copy link

codecov bot commented Feb 10, 2019

Codecov Report

Merging #60 into master will decrease coverage by 0.35%.
The diff coverage is 85.88%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #60      +/-   ##
==========================================
- Coverage    93.7%   93.35%   -0.36%     
==========================================
  Files          10       10              
  Lines         556      677     +121     
==========================================
+ Hits          521      632     +111     
- Misses         18       24       +6     
- Partials       17       21       +4
Impacted Files Coverage Δ
faker.go 89.38% <85.88%> (+1.3%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 0dbcd79...7d4bcf0. Read the comment docs.

@bxcodec bxcodec changed the title Length Support feat(faker): length Support Feb 11, 2019
@bxcodec
Copy link
Owner

bxcodec commented Feb 11, 2019

Thanks for the PR. Really appreciate it. This PR already looks good to me.
But, just a suggestion if you have more spare time. It will be more complete if we can also support it from the struct's tag.

Maybe something like this:

type Some struct {
ArrayOfSomething []string `faker:",maxlen=20"`
StringOfSomething string `faker:",maxlen=25"`
FirstName string `faker:"first_name, maxlen=15"`
}

*maxlen aslo can be replaced with len`

If just in case you have spare time anyway. If you too busy, then it's okay to merge this for now

@olimpias
Copy link
Contributor Author

olimpias commented Feb 11, 2019 via email

@olimpias
Copy link
Contributor Author

Merging with other tags will take time. I think for now, this will be enough :).

@bxcodec
Copy link
Owner

bxcodec commented Feb 19, 2019

Thank you for the PR.
If you don't mind, maybe you can add how to use it in the Readme.md.
You can add an example to existing readme.

Copy link
Owner

@bxcodec bxcodec left a comment

Choose a reason for hiding this comment

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

Many thanks @olimpias

It seem looks good to merge 👍

@bxcodec bxcodec merged commit 8221bfa into bxcodec:master Feb 20, 2019
@bxcodec bxcodec mentioned this pull request Feb 20, 2019
6 tasks
@olimpias
Copy link
Contributor Author

olimpias commented Feb 20, 2019 via email

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

Successfully merging this pull request may close these issues.

Support for less than tags with numbers and length of strings
2 participants