Skip to content

Commit

Permalink
Change License
Browse files Browse the repository at this point in the history
  • Loading branch information
goloop committed Jun 6, 2023
1 parent 3837f59 commit 4b45d06
Show file tree
Hide file tree
Showing 13 changed files with 60 additions and 222 deletions.
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,6 @@
# Dependency directories
# vendor/
.vscode/
cmd/
cmd/

coverage.out
49 changes: 0 additions & 49 deletions .godocdown.md

This file was deleted.

41 changes: 19 additions & 22 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -1,24 +1,21 @@
Copyright (c) 2022, GoLoop.
All rights reserved.
MIT License

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
3. Neither the name of the GoLoop nor the
names of its contributors may be used to endorse or promote products
derived from this software without specific prior written permission.
Copyright (c) 2020 GoLoop

THIS SOFTWARE IS PROVIDED BY COPYRIGHT HOLDER AND CONTRIBUTORS ''AS IS'' AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL COPYRIGHT HOLDER AND CONTRIBUTORS BE LIABLE FOR
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
59 changes: 0 additions & 59 deletions Makefile

This file was deleted.

78 changes: 26 additions & 52 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
[//]: # (!!!Don't modify the README.md, use `make readme` to generate it!!!)
[![Go Report Card](https://goreportcard.com/badge/github.com/goloop/slug)](https://goreportcard.com/report/github.com/goloop/slug) [![License](https://img.shields.io/badge/license-MIT-brightgreen)](https://github.com/goloop/slug/blob/master/LICENSE) [![License](https://img.shields.io/badge/godoc-YES-green)](https://godoc.org/github.com/goloop/slug)


[![Go Report Card](https://goreportcard.com/badge/github.com/goloop/slug)](https://goreportcard.com/report/github.com/goloop/slug) [![License](https://img.shields.io/badge/license-BSD-blue)](https://github.com/goloop/slug/blob/master/LICENSE) [![License](https://img.shields.io/badge/godoc-YES-green)](https://godoc.org/github.com/goloop/slug)

*Version: v0.0.2*

# slug

Package slug generate slug from Unicode string, URL-friendly slugify with
Expand All @@ -15,7 +11,9 @@ multiple languages support.

To install this module use `go get` as:

$ go get -u github.com/goloop/slug
```
$ go get -u github.com/goloop/slug
```

## Quick Start

Expand All @@ -40,73 +38,49 @@ func main() {
// Simple generate slug from the string.
s := slug.Make("Hello 世界")
h := "https://example.com/"
fmt.Printf("%s%s\n", h, s)

// Output:
// https://example.com/Hello-Shi-Jie
fmt.Printf("%s%s\n", h, s)
// Output: https://example.com/Hello-Shi-Jie
}
```

## Usage

#### func Lower

func Lower(t string) string

Lower returns slug in lowercase.

#### func Make

func Make(t string) string

Make returns slug from string.

#### func Upper

func Upper(t string) string

Upper returns slug in uppercase.

#### func Version

func Version() string
## Functions

Version returns the version of the module.
- **Lower**(t string) string

#### type Slug
Lower returns slug in lowercase.

type Slug struct {
}
- **Make**(t string) string

Make returns slug from string.

Slug is the slug constructor.
- **Upper**(t string) string

#### func New
Upper returns slug in uppercase.

func New() *Slug
- **Version**() string

New retursn pointer to Slug.
Version returns the version of the module.

#### func (*Slug) Lang
- **New*() *Slug

func (s *Slug) Lang(l string) *Slug
New returns pointer to Slug.

Lang sets the type of language features to use during slugify.

#### func (*Slug) Lower
## Methods of Slug

func (s *Slug) Lower(t string) string
- **Lang**(l string) *Slug

Lower returns slug in lowercase.
Lang sets the type of language features to use during slugify.

#### func (*Slug) Make
- **Lower**(t string) string

func (s *Slug) Make(t string) string
Lower returns slug in lowercase.

Make returns slug from string.
- **Make**(t string) string

#### func (*Slug) Upper
Make returns slug from string.

func (s *Slug) Upper(t string) string
- **Upper**(t string) string

Upper returns slug in uppercase.
Upper returns slug in uppercase.
7 changes: 0 additions & 7 deletions doc.go
Original file line number Diff line number Diff line change
@@ -1,10 +1,3 @@
// Package slug generate slug from Unicode string,
// URL-friendly slugify with multiple languages support.
package slug

const version = "0.0.2"

// Version returns the version of the module.
func Version() string {
return "v" + version
}
22 changes: 0 additions & 22 deletions doc_test.go

This file was deleted.

4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
module github.com/goloop/slug

go 1.17
go 1.20

require github.com/goloop/t13n v1.2.1
require github.com/goloop/t13n v1.4.0
6 changes: 4 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
github.com/goloop/t13n v1.2.1 h1:ArpoIEGoUCmvHvNvL+R1YdtkmWJrNjWEI7mUpwLjXho=
github.com/goloop/t13n v1.2.1/go.mod h1:1A8l9eGVc905TSEVbUS36ctQSEFtW7n5FBOc1Tp32r8=
github.com/goloop/t13n v1.3.2 h1:enhFPS4rZvp77ai6cbJg2zvsxFC0ZVlT34xsUPdmW7g=
github.com/goloop/t13n v1.3.2/go.mod h1:JCd2qLplmTZHTFq9K8PoW7UVghN1KCTFS8qMBh0nhfY=
github.com/goloop/t13n v1.4.0 h1:HFlP1sExMzaoZBgchycHaHxeVt61Qfp3t4dt7E3pYc8=
github.com/goloop/t13n v1.4.0/go.mod h1:JCd2qLplmTZHTFq9K8PoW7UVghN1KCTFS8qMBh0nhfY=
4 changes: 2 additions & 2 deletions methods_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (

// TestMake tests Make function.
func TestMake(t *testing.T) {
var tests = []struct {
tests := []struct {
value string
expected string
}{
Expand All @@ -30,7 +30,7 @@ func TestMake(t *testing.T) {

// TestLower tests Lower function.
func TestLower(t *testing.T) {
var tests = []struct {
tests := []struct {
value string
lowerExpected string
upperExpected string
Expand Down
4 changes: 2 additions & 2 deletions slug_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (

// TestObjMake tests Make method.
func TestObjMake(t *testing.T) {
var tests = []struct {
tests := []struct {
value string
expected string
}{
Expand All @@ -34,7 +34,7 @@ func TestObjMake(t *testing.T) {

// TestObjLower tests Lower method.
func TestObjLower(t *testing.T) {
var tests = []struct {
tests := []struct {
value string
lowerExpected string
upperExpected string
Expand Down
2 changes: 1 addition & 1 deletion tools.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (
func slugRules(ts lang.TransState) (string, int, bool) {
// Ignore ranges.
// Important: edit maps ascending order only!
var ignored = [][]int{
ignored := [][]int{
{0, 47},
{58, 64},
{91, 96},
Expand Down
2 changes: 1 addition & 1 deletion tools_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (

// TestSlugRules tests slugRules function.
func TestSlugRules(t *testing.T) {
var tests = []struct {
tests := []struct {
item lang.TransState
value string
seek int
Expand Down

0 comments on commit 4b45d06

Please sign in to comment.