Skip to content

Commit

Permalink
chore: Copyright
Browse files Browse the repository at this point in the history
  • Loading branch information
xjh22222228 committed Jan 10, 2021
1 parent aed58d7 commit 083e3e5
Show file tree
Hide file tree
Showing 35 changed files with 80 additions and 27 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@ jobs:
- name: Run Test
run: |
go mod tidy -v
go test -race --cover -v ./...
go test -bench=. -benchmem -race --cover -v ./...
7 changes: 6 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ go get -d github.com/xjh22222228/gosh



## Demo
## Getting Started
```golang
package main

Expand All @@ -46,3 +46,8 @@ func main() {
}
```

More in-depth info can be found in the runtime [documentation](https://xjh22222228.github.io/gosh).


## Contributing
We appreciate your help!
7 changes: 6 additions & 1 deletion README_zh-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ go get -d github.com/xjh22222228/gosh
```


## 例子
## 入门
```golang
package main

Expand All @@ -44,3 +44,8 @@ func main() {
}
```

可以在运行时[文档中](https://xiejiahe.gitee.io/gosh)找到更多详细信息。


## 贡献
感谢您的帮助!
5 changes: 5 additions & 0 deletions gosh.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
// Copyright 2020-2021 the Gosh authors. All rights reserved. MIT license.

package gosh

const Version = "v0.0.3"
2 changes: 2 additions & 0 deletions grandom/choice.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Copyright 2020-2021 the Gosh authors. All rights reserved. MIT license.

package grandom

import "log"
Expand Down
2 changes: 2 additions & 0 deletions grandom/rand_bool.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Copyright 2020-2021 the Gosh authors. All rights reserved. MIT license.

package grandom

func RandBool() bool {
Expand Down
11 changes: 0 additions & 11 deletions grandom/rand_bool_test.go

This file was deleted.

2 changes: 2 additions & 0 deletions grandom/rand_int.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Copyright 2020-2021 the Gosh authors. All rights reserved. MIT license.

package grandom

import (
Expand Down
7 changes: 5 additions & 2 deletions grandom/rand_int_test.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package grandom

import (
"fmt"
"github.com/stretchr/testify/assert"
"math"
"testing"
Expand All @@ -11,6 +10,10 @@ func TestRandInt(t *testing.T) {
_assert := assert.New(t)
_assert.LessOrEqual(RandInt(5, 5), 5)
_assert.GreaterOrEqual(RandInt(5, 100), 5)
}

fmt.Println(RandInt(-10, math.MaxInt32))
func BenchmarkRandInt(b *testing.B) {
for i := 0; i < b.N; i++ {
RandInt(1 << 31, int(math.Abs(1 << 31)))
}
}
2 changes: 2 additions & 0 deletions grandom/random.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Copyright 2020-2021 the Gosh authors. All rights reserved. MIT license.

package grandom

import (
Expand Down
2 changes: 2 additions & 0 deletions grandom/sample.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Copyright 2020-2021 the Gosh authors. All rights reserved. MIT license.

package grandom

import "log"
Expand Down
2 changes: 2 additions & 0 deletions grandom/shuffle.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Copyright 2020-2021 the Gosh authors. All rights reserved. MIT license.

package grandom

func ShuffleInt(numbers []int) {
Expand Down
2 changes: 2 additions & 0 deletions gslice/fill.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Copyright 2020-2021 the Gosh authors. All rights reserved. MIT license.

package gslice

// https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/Array/fill
Expand Down
3 changes: 0 additions & 3 deletions gslice/fill_test.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package gslice

import (
"fmt"
"github.com/stretchr/testify/assert"
"strings"
"testing"
Expand All @@ -22,6 +21,4 @@ func TestFill(t *testing.T) {

Fill(elems, "6", 0)
_assert.Equal("6666", strings.Join(elems, ""))

fmt.Println(elems)
}
2 changes: 2 additions & 0 deletions gslice/slice.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Copyright 2020-2021 the Gosh authors. All rights reserved. MIT license.

package gslice

// https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/Array/slice
Expand Down
2 changes: 2 additions & 0 deletions gslice/splice.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Copyright 2020-2021 the Gosh authors. All rights reserved. MIT license.

package gslice

import (
Expand Down
7 changes: 7 additions & 0 deletions gslice/splice_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,3 +52,10 @@ func TestSplice(t *testing.T) {
_assert.Equal("angel,clown", strings.Join(v, ","))
}

func BenchmarkSplice(b *testing.B) {
for i := 0; i < b.N; i++ {
elems := []string{"angel", "clown", "drum", "mandarin", "sturgeon"}
Splice(&elems, 2, 3, "a", "b", "c")
}
}

2 changes: 2 additions & 0 deletions gstrings/center.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Copyright 2020-2021 the Gosh authors. All rights reserved. MIT license.

package gstrings

import (
Expand Down
2 changes: 2 additions & 0 deletions gstrings/concat.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Copyright 2020-2021 the Gosh authors. All rights reserved. MIT license.

package gstrings

import (
Expand Down
2 changes: 2 additions & 0 deletions gstrings/ends_with.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Copyright 2020-2021 the Gosh authors. All rights reserved. MIT license.

package gstrings

func EndsWith(str, searchString string, length ...int) bool {
Expand Down
2 changes: 2 additions & 0 deletions gstrings/includes.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Copyright 2020-2021 the Gosh authors. All rights reserved. MIT license.

package gstrings

import (
Expand Down
2 changes: 2 additions & 0 deletions gstrings/index_of.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Copyright 2020-2021 the Gosh authors. All rights reserved. MIT license.

package gstrings

import (
Expand Down
2 changes: 2 additions & 0 deletions gstrings/last_index_of.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Copyright 2020-2021 the Gosh authors. All rights reserved. MIT license.

package gstrings

import (
Expand Down
2 changes: 2 additions & 0 deletions gstrings/pad_end.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Copyright 2020-2021 the Gosh authors. All rights reserved. MIT license.

package gstrings

import "strings"
Expand Down
2 changes: 2 additions & 0 deletions gstrings/pad_start.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Copyright 2020-2021 the Gosh authors. All rights reserved. MIT license.

package gstrings

import (
Expand Down
2 changes: 2 additions & 0 deletions gstrings/reverse.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Copyright 2020-2021 the Gosh authors. All rights reserved. MIT license.

package gstrings

import "strings"
Expand Down
2 changes: 2 additions & 0 deletions gstrings/search.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Copyright 2020-2021 the Gosh authors. All rights reserved. MIT license.

package gstrings

import (
Expand Down
2 changes: 2 additions & 0 deletions gstrings/shuffle.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Copyright 2020-2021 the Gosh authors. All rights reserved. MIT license.

package gstrings

import (
Expand Down
2 changes: 2 additions & 0 deletions gstrings/slice.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Copyright 2020-2021 the Gosh authors. All rights reserved. MIT license.

package gstrings

func Slice(s string, beginIndex int, endIndex ...int) string {
Expand Down
2 changes: 2 additions & 0 deletions gstrings/starts_with.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Copyright 2020-2021 the Gosh authors. All rights reserved. MIT license.

package gstrings

func StartsWith(s, searchString string, position ...int) bool {
Expand Down
2 changes: 2 additions & 0 deletions gstrings/trim.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Copyright 2020-2021 the Gosh authors. All rights reserved. MIT license.

package gstrings

import "strings"
Expand Down
2 changes: 2 additions & 0 deletions gstrings/trim_end.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Copyright 2020-2021 the Gosh authors. All rights reserved. MIT license.

package gstrings

import "regexp"
Expand Down
2 changes: 2 additions & 0 deletions gstrings/trim_start.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Copyright 2020-2021 the Gosh authors. All rights reserved. MIT license.

package gstrings

import "regexp"
Expand Down
5 changes: 0 additions & 5 deletions main.go

This file was deleted.

3 changes: 0 additions & 3 deletions version.go

This file was deleted.

0 comments on commit 083e3e5

Please sign in to comment.