Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Structure for re-usability and concurrency #51

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

System-Glitch
Copy link

@System-Glitch System-Glitch commented Oct 30, 2020

Description

Create a structure and make it implement the slug functions.

Benefits:

  • Ability to slug concurrently with different settings (this wasn't possible because of global variables)
  • Better re-usability

Drawback:

  • Very slightly slower due to map cloning when creating a new Slug structure.

Example usage

s := slug.New()
s.MaxLength = 80
s.Make("Hello world")

Notes

This change is not breaking.

Similar to #41

@codecov
Copy link

codecov bot commented Oct 30, 2020

Codecov Report

Merging #51 into master will not change coverage.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff            @@
##            master       #51   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files            2         2           
  Lines           84        83    -1     
=========================================
- Hits            84        83    -1     
Impacted Files Coverage Δ
slug.go 100.00% <100.00%> (ø)
languages_substitution.go 100.00% <0.00%> (ø)

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 8535650...9d423a1. Read the comment docs.

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

Successfully merging this pull request may close these issues.

None yet

2 participants