added support for custom separators#35
Conversation
|
Basically created this because this is almost perfect for use in file paths, but only being different because we want to keep the spaces in our file/folder names. So our use case would be setting |
|
Hi, thank you for this PR. I'm sick now and don't have much strength for review so just some short comments. Could you add tests to this new functionality? I prefer tests generated by https://github.com/cweill/gotests if possible. Could you move 'init' to top? I'm not so fond of getters and setters but looks like we need them to not broke API. But could you change they names to stick with official guidelines Thank you |
|
Also did you looked at benchmarks how much speed degrade with your change? You could add info about it to doc.go and readme or I will do it after merging. |
|
Awesome, I can make those changes, and I'll do some before/after benchmark
testing as well
…On Sat, Sep 14, 2019 at 2:51 AM Dobrosław Żybort ***@***.***> wrote:
Also did you looked at benchmarks how much speed degrade with your change?
You could add info about it to doc.go and readme or I will do it after
merging.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#35?email_source=notifications&email_token=AAJHC7RJUFIVKTGAEI7FOE3QJSCVLA5CNFSM4IV2M5C2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD6WV4AY#issuecomment-531455491>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAJHC7WD6Z5VOWQSIC25OV3QJSCVLANCNFSM4IV2M5CQ>
.
|
Added support for setting custom separators via
slug.SetSeparator("-")This keeps the backwards compatibility, passes all the tests, and allows for the use of longer strings, i.e. not just single characters.
There's also a
slug.GetSeparator()function so you can see what the current separator is set to.