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

feat: add v4 initial version, with options and restructured package #169

Merged
merged 15 commits into from
Aug 20, 2022

Conversation

bxcodec
Copy link
Owner

@bxcodec bxcodec commented Aug 17, 2022

fix #153
fix #144
fix #114


// Single fake function can be used for retrieving particular values.
func Example_singleFakeData() {

// Address
faker.Latitude() // => 81.12195
faker.Longitude() // => -84.38158
faker.Latitude(options.DefaultOption()) // => 81.12195
Copy link
Contributor

Choose a reason for hiding this comment

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

Now every function got a required param? I think optional param (like ...options.OptionFunc) is a better idea, It's easier to upgrade from V3.

Copy link
Owner Author

Choose a reason for hiding this comment

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

PR updated. please help to re-review again

options/options.go Outdated Show resolved Hide resolved
faker_test.go Show resolved Hide resolved
datetime.go Outdated Show resolved Hide resolved
options/options.go Outdated Show resolved Hide resolved
wolf-joe and others added 2 commits August 19, 2022 13:39
* feat: update WithRecursionMaxDepth & unittest

* style: remove unnecessary check
@bxcodec
Copy link
Owner Author

bxcodec commented Aug 19, 2022

@wolf-joe can you help to re-review again?

I decided to keep Options publicly available, the reason is just it's the faker option, and people can read it as they want.
So they can be aware what are the options that we provided.

@bxcodec bxcodec requested review from wolf-joe and ridhoperdana and removed request for wolf-joe and ridhoperdana August 19, 2022 16:46
@bxcodec bxcodec requested review from wolf-joe and ridhoperdana and removed request for ridhoperdana and wolf-joe August 19, 2022 16:46
}

// SetRandomMapAndSliceMaxSize sets the max size for maps and slices for random generation.
func SetRandomMapAndSliceMaxSize(size int) error {
Copy link
Contributor

@wolf-joe wolf-joe Aug 20, 2022

Choose a reason for hiding this comment

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

I prefer to keep those set function, it provides global setting ability and back forward compatibility

Copy link
Owner Author

@bxcodec bxcodec Aug 20, 2022

Choose a reason for hiding this comment

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

I don't think this is possible, since we remove the global variables, and use options

Copy link
Owner Author

Choose a reason for hiding this comment

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

And since we're introducing major version, breaking changes is acceptable.

And no need to be 100% backward compatibility

@bxcodec
Copy link
Owner Author

bxcodec commented Aug 20, 2022

I'm merging this now and will release a v4.0.0-beta version.
And will do fixing for any incoming issues after this breaking releases.

@bxcodec bxcodec merged commit a94c89d into master Aug 20, 2022
@bxcodec bxcodec deleted the feat/v4-initial-version branch August 20, 2022 05:35
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.

slice_len only works for string Max depth parameter fatal error: concurrent map writes
3 participants