Skip to content

feat: add isbn 10/13 fake generation support#368

Merged
brianvoe merged 2 commits intobrianvoe:ISBNfrom
phoenisx:feat/issue-367-add-isbn-fakes
Jun 21, 2025
Merged

feat: add isbn 10/13 fake generation support#368
brianvoe merged 2 commits intobrianvoe:ISBNfrom
phoenisx:feat/issue-367-add-isbn-fakes

Conversation

@phoenisx
Copy link
Copy Markdown
Contributor

Closes #367

Description

Adds support for ISBN 10/13 strings in gofakeit library. It's inspired from https://github.com/joke2k/faker/blob/master/faker/providers/isbn

Currently added support for only en-US regions, i.e. 0 & 1 Registration Groups. We can expand this data to support other regions/countries if required in future.


Let me know your thoughts, and any fixes if necessary, coz this will be my first Golang PR 😅 🎉 🙌🏽

@brianvoe
Copy link
Copy Markdown
Owner

Sorry I missed this.

The pr looks good. The only thing i question is the categorization. Instead of creating a new one lets put it under product.

Once that update is done ill get this merged in.

Nice job!

@phoenisx
Copy link
Copy Markdown
Contributor Author

Thanks @brianvoe for the review.

I have one concern merging ISBN with Product:

  • I can either support ISBN 10 and 13 as two separate properties in Product struct, or
  • I support only one ISBN string, which by default sets to ISBN13 and if user passes an option/param (which modifies the Product() function signature) use ISBN 10 or 13 based on that option.

Which one do you think would work the best here?

@brianvoe
Copy link
Copy Markdown
Owner

Lets do the more common ISBN 13

@praxisdj
Copy link
Copy Markdown

any update on this?

@brianvoe
Copy link
Copy Markdown
Owner

@phoenisx is anything else you need to do for this pr?

@phoenisx
Copy link
Copy Markdown
Contributor Author

Apologies for the delay, I was occupied with other things.

I've made the changes to accommodate the requested changes earlier, though I'm facing issues with the tests.
ISBN Tests intermittently fail for me.
I know I am using faker functions to generate the ISBN elements, but I am not able to find why, even after the seed, the output for ISBN string changes sometimes in the tests

Maybe someone can help me here 🙇🏽

@brianvoe brianvoe changed the base branch from master to ISBN June 21, 2025 20:06
@brianvoe
Copy link
Copy Markdown
Owner

I got you. Im gonna do some cleanup and simplification but ill keep your general feature in mind and get tests working.

@brianvoe brianvoe merged commit 7b29b65 into brianvoe:ISBN Jun 21, 2025
0 of 3 checks passed
@phoenisx phoenisx deleted the feat/issue-367-add-isbn-fakes branch June 22, 2025 04:00
@brianvoe
Copy link
Copy Markdown
Owner

v7.3.0

I did some major cleanup and simplification

@brianvoe
Copy link
Copy Markdown
Owner

https://github.com/brianvoe/gofakeit/releases/tag/v7.3.0

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.

Support ISBN 10 and ISBN13

3 participants