1
- # go-tool
1
+ # go-tool v2
2
2
3
3
[ ![ Github License] ( https://img.shields.io/github/license/sliveryou/go-tool.svg?style=flat )] ( https://github.com/sliveryou/go-tool/blob/master/LICENSE )
4
- [ ![ Go Doc] ( https://godoc.org/github.com/sliveryou/go-tool?status.svg )] ( https://pkg.go.dev/github.com/sliveryou/go-tool )
5
- [ ![ Go Report] ( https://goreportcard.com/badge/github.com/sliveryou/go-tool )] ( https://goreportcard.com/report/github.com/sliveryou/go-tool )
4
+ [ ![ Go Doc] ( https://godoc.org/github.com/sliveryou/go-tool/v2 ?status.svg )] ( https://pkg.go.dev/github.com/sliveryou/go-tool/v2 )
5
+ [ ![ Go Report] ( https://goreportcard.com/badge/github.com/sliveryou/go-tool/v2 )] ( https://goreportcard.com/report/github.com/sliveryou/go-tool/v2 )
6
6
[ ![ Github Latest Release] ( https://img.shields.io/github/release/sliveryou/go-tool.svg?style=flat )] ( https://github.com/sliveryou/go-tool/releases/latest )
7
7
[ ![ Github Latest Tag] ( https://img.shields.io/github/tag/sliveryou/go-tool.svg?style=flat )] ( https://github.com/sliveryou/go-tool/tags )
8
8
[ ![ Github Stars] ( https://img.shields.io/github/stars/sliveryou/go-tool.svg?style=flat )] ( https://github.com/sliveryou/go-tool/stargazers )
@@ -29,7 +29,7 @@ go 常用工具函数集合
29
29
30
30
``` go
31
31
import (
32
- " github.com/sliveryou/go-tool/cipher"
32
+ " github.com/sliveryou/go-tool/v2/ cipher"
33
33
)
34
34
35
35
type Cipher
@@ -38,7 +38,7 @@ type Cipher
38
38
39
39
// aes
40
40
import (
41
- "github.com/sliveryou/go-tool/cipher/aes"
41
+ "github.com/sliveryou/go-tool/v2/ cipher/aes"
42
42
)
43
43
44
44
func AesCbcDecrypt(key, iv, src []byte) ([]byte, error)
@@ -54,7 +54,7 @@ type AesCbc
54
54
55
55
// pkcs
56
56
import (
57
- "github.com/sliveryou/go-tool/cipher/pkcs"
57
+ "github.com/sliveryou/go-tool/v2/ cipher/pkcs"
58
58
)
59
59
60
60
func PKCS5Padding(cipherText []byte) []byte
@@ -67,7 +67,7 @@ func PKCS7Trimming(encrypt []byte) ([]byte, error)
67
67
68
68
```go
69
69
import (
70
- "github.com/sliveryou/go-tool/convert"
70
+ "github.com/sliveryou/go-tool/v2/ convert"
71
71
)
72
72
73
73
func BinToDec(bin string) int64
@@ -106,7 +106,7 @@ func Uint64ToBytes(i uint64) []byte
106
106
107
107
```go
108
108
import (
109
- "github.com/sliveryou/go-tool/filex"
109
+ "github.com/sliveryou/go-tool/v2/ filex"
110
110
)
111
111
112
112
func AbsPath(filePath string) (string, error)
@@ -138,7 +138,7 @@ func Write(fileName string, data []byte, perm ...os.FileMode) error
138
138
```go
139
139
// encoding/base58
140
140
import (
141
- "github.com/sliveryou/go-tool/id-generator/encoding/base58"
141
+ "github.com/sliveryou/go-tool/v2/ id-generator/encoding/base58"
142
142
)
143
143
144
144
func StdSource() string
@@ -150,7 +150,7 @@ type Encoder
150
150
151
151
// encoding/base62
152
152
import (
153
- "github.com/sliveryou/go-tool/id-generator/encoding/base62"
153
+ "github.com/sliveryou/go-tool/v2/ id-generator/encoding/base62"
154
154
)
155
155
156
156
func StdSource() string
@@ -162,7 +162,7 @@ type Encoder
162
162
163
163
// snowflake
164
164
import (
165
- "github.com/sliveryou/go-tool/id-generator/snowflake"
165
+ "github.com/sliveryou/go-tool/v2/ id-generator/snowflake"
166
166
)
167
167
168
168
func NodeId(nodeId int64) func() (int64, error)
@@ -174,7 +174,7 @@ type Snowflake
174
174
175
175
// uuid
176
176
import (
177
- "github.com/sliveryou/go-tool/id-generator/uuid"
177
+ "github.com/sliveryou/go-tool/v2/ id-generator/uuid"
178
178
)
179
179
func NextV1() string
180
180
func NextV4() string
@@ -185,7 +185,7 @@ func Parse(input string) (uuid.UUID, error)
185
185
186
186
```go
187
187
import (
188
- "github.com/sliveryou/go-tool/mathx"
188
+ "github.com/sliveryou/go-tool/v2/ mathx"
189
189
)
190
190
191
191
func AbsFloat(num float64) float64
@@ -247,7 +247,7 @@ func SumInt64(nums ...int64) int64
247
247
248
248
```go
249
249
import (
250
- "github.com/sliveryou/go-tool/mathg"
250
+ "github.com/sliveryou/go-tool/v2/ mathg"
251
251
)
252
252
253
253
func Abs[T constraints.Signed | constraints.Float](n T) T
@@ -270,7 +270,7 @@ func Sum[T constraints.Ordered](nums ...T) T
270
270
271
271
```go
272
272
import (
273
- "github.com/sliveryou/go-tool/randx"
273
+ "github.com/sliveryou/go-tool/v2/ randx"
274
274
)
275
275
276
276
func NewNumber(length int) string
@@ -284,7 +284,7 @@ func StdSource() string
284
284
285
285
```go
286
286
import (
287
- "github.com/sliveryou/go-tool/slicex"
287
+ "github.com/sliveryou/go-tool/v2/ slicex"
288
288
)
289
289
290
290
func Contain(slice, value interface{}) (index int )
@@ -419,7 +419,7 @@ func UniqueStrings(slice []string) []string
419
419
420
420
```go
421
421
import (
422
- "github.com/sliveryou/go-tool/sliceg"
422
+ "github.com/sliveryou/go-tool/v2/ sliceg"
423
423
)
424
424
425
425
func Contain[T comparable](s []T, v T) bool
@@ -442,7 +442,7 @@ func Unique[T comparable](s []T) []T
442
442
443
443
```go
444
444
import (
445
- "github.com/sliveryou/go-tool/timex"
445
+ "github.com/sliveryou/go-tool/v2/ timex"
446
446
)
447
447
448
448
func Date(t time.Time, location ...*time.Location) string
@@ -495,7 +495,7 @@ func UnixTodayRange(location ...*time.Location) (int64, int64)
495
495
496
496
```go
497
497
import (
498
- "github.com/sliveryou/go-tool/validator"
498
+ "github.com/sliveryou/go-tool/v2/ validator"
499
499
)
500
500
501
501
func ParseErr(err error) string
0 commit comments