changed dependency for gosimple/slug, they had finally removed the gopkgs dependency, Fixes #2153
This commit is contained in:
-6
@@ -1,6 +0,0 @@
|
||||
unidecode
|
||||
=========
|
||||
|
||||
Unicode transliterator in Golang - Replaces non-ASCII characters with their ASCII approximations.
|
||||
|
||||
View other available versions, documentation and examples at http://gopkgs.com/unidecode
|
||||
-5
File diff suppressed because one or more lines are too long
@@ -0,0 +1,2 @@
|
||||
_*
|
||||
cover*.out
|
||||
Generated
Vendored
+7
-3
@@ -4,9 +4,10 @@ slug
|
||||
Package `slug` generate slug from unicode string, URL-friendly slugify with
|
||||
multiple languages support.
|
||||
|
||||
[](https://godoc.org/github.com/dalu/slug)
|
||||
[](https://godoc.org/github.com/gosimple/slug)
|
||||
[](https://drone.io/github.com/gosimple/slug/latest)
|
||||
|
||||
[Documentation online](http://godoc.org/github.com/dalu/slug)
|
||||
[Documentation online](http://godoc.org/github.com/gosimple/slug)
|
||||
|
||||
## Example
|
||||
|
||||
@@ -37,9 +38,12 @@ multiple languages support.
|
||||
fmt.Println(textSub) // Will print 'sand-is-hot'
|
||||
}
|
||||
|
||||
### Requests or bugs?
|
||||
<https://github.com/gosimple/slug/issues>
|
||||
|
||||
## Installation
|
||||
|
||||
go get -u github.com/dalu/slug
|
||||
go get -u github.com/gosimple/slug
|
||||
|
||||
## License
|
||||
|
||||
Generated
Vendored
Generated
Vendored
+5
-1
@@ -12,7 +12,7 @@ Example:
|
||||
package main
|
||||
|
||||
import(
|
||||
"github.com/dalu/slug"
|
||||
"github.com/gosimple/slug"
|
||||
"fmt"
|
||||
)
|
||||
|
||||
@@ -35,5 +35,9 @@ Example:
|
||||
textSub := slug.Make("water is hot")
|
||||
fmt.Println(textSub) // Will print 'sand-is-hot'
|
||||
}
|
||||
|
||||
Requests or bugs?
|
||||
|
||||
https://github.com/gosimple/slug/issues
|
||||
*/
|
||||
package slug
|
||||
Generated
Vendored
Generated
Vendored
+2
-1
@@ -6,9 +6,10 @@
|
||||
package slug
|
||||
|
||||
import (
|
||||
"github.com/dalu/unidecode"
|
||||
"regexp"
|
||||
"strings"
|
||||
|
||||
"github.com/rainycape/unidecode"
|
||||
)
|
||||
|
||||
var (
|
||||
Generated
Vendored
Generated
Vendored
+6
@@ -0,0 +1,6 @@
|
||||
unidecode
|
||||
=========
|
||||
|
||||
Unicode transliterator in Golang - Replaces non-ASCII characters with their ASCII approximations.
|
||||
|
||||
[](https://godoc.org/github.com/rainycape/unidecode)
|
||||
Generated
Vendored
-3
@@ -5,12 +5,9 @@ import (
|
||||
"encoding/binary"
|
||||
"io"
|
||||
"strings"
|
||||
"sync"
|
||||
)
|
||||
|
||||
var (
|
||||
decoded = false
|
||||
mutex sync.Mutex
|
||||
transliterations [65536][]rune
|
||||
transCount = rune(len(transliterations))
|
||||
getUint16 = binary.LittleEndian.Uint16
|
||||
Generated
Vendored
+4
@@ -0,0 +1,4 @@
|
||||
package unidecode
|
||||
|
||||
// AUTOGENERATED - DO NOT EDIT!
|
||||
|
||||
Generated
Vendored
Generated
Vendored
+4
-11
@@ -4,15 +4,15 @@
|
||||
package unidecode
|
||||
|
||||
import (
|
||||
"sync"
|
||||
"unicode"
|
||||
|
||||
"gopkgs.com/pool.v1"
|
||||
)
|
||||
|
||||
const pooledCapacity = 64
|
||||
|
||||
var (
|
||||
slicePool = pool.New(0)
|
||||
slicePool sync.Pool
|
||||
decodingOnce sync.Once
|
||||
)
|
||||
|
||||
// Unidecode implements a unicode transliterator, which
|
||||
@@ -23,14 +23,7 @@ var (
|
||||
// with their closest ASCII counterparts.
|
||||
// e.g. Unicode("áéíóú") => "aeiou"
|
||||
func Unidecode(s string) string {
|
||||
if !decoded {
|
||||
mutex.Lock()
|
||||
if !decoded {
|
||||
decodeTransliterations()
|
||||
decoded = true
|
||||
}
|
||||
mutex.Unlock()
|
||||
}
|
||||
decodingOnce.Do(decodeTransliterations)
|
||||
l := len(s)
|
||||
var r []rune
|
||||
if l > pooledCapacity {
|
||||
Reference in New Issue
Block a user