gosimple / slug

URL-friendly slugify with multiple languages support.
Mozilla Public License 2.0
1.15k stars 108 forks source link

Added Generating Slugs with Random Numbers #82

Open tuncaydamlar opened 1 year ago

tuncaydamlar commented 1 year ago

This pull request adds a new function named "MakeWithRandomNumber" to the project. This function allows users to automatically generate a slug from the provided text-based input and append a random 3-digit number to the end of the slug. This provides developers with an easy way to create unique and randomized slugs.

The new function is based on the existing slug generation logic of the project and uses the "en" language. It also uses a reliable seed value for generating random numbers, ensuring that you get different slugs every time you run it.

codecov[bot] commented 1 year ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 100.00%. Comparing base (412e31a) to head (dfb2d85).

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #82 +/- ## ========================================= Coverage 100.00% 100.00% ========================================= Files 2 2 Lines 126 133 +7 ========================================= + Hits 126 133 +7 ``` | [Files](https://app.codecov.io/gh/gosimple/slug/pull/82?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=gosimple) | Coverage Δ | | |---|---|---| | [slug.go](https://app.codecov.io/gh/gosimple/slug/pull/82?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=gosimple#diff-c2x1Zy5nbw==) | `100.00% <100.00%> (ø)` | |