diff --git a/bytepkg/bytes.go b/bytes/bytes.go similarity index 98% rename from bytepkg/bytes.go rename to bytes/bytes.go index 6ef5991..a243412 100644 --- a/bytepkg/bytes.go +++ b/bytes/bytes.go @@ -1,4 +1,4 @@ -package bytepkg +package bytes import ( "unsafe" diff --git a/certpkg/cert.go b/certs/cert.go similarity index 97% rename from certpkg/cert.go rename to certs/cert.go index fb7864c..2075820 100644 --- a/certpkg/cert.go +++ b/certs/cert.go @@ -1,4 +1,4 @@ -package certpkg +package certs import ( "crypto/tls" diff --git a/clonepkg/clone.go b/clones/clone.go similarity index 99% rename from clonepkg/clone.go rename to clones/clone.go index 58551a8..5ea1740 100644 --- a/clonepkg/clone.go +++ b/clones/clone.go @@ -1,4 +1,4 @@ -package clonepkg +package clones import "reflect" diff --git a/cryptopkg/encrypt.go b/cryptos/encrypt.go similarity index 98% rename from cryptopkg/encrypt.go rename to cryptos/encrypt.go index dd8d0be..cf401ef 100644 --- a/cryptopkg/encrypt.go +++ b/cryptos/encrypt.go @@ -1,4 +1,4 @@ -package cryptopkg +package cryptos import ( "encoding/base64" diff --git a/errpkg/error.go b/errors/error.go similarity index 94% rename from errpkg/error.go rename to errors/error.go index 9abd78e..ba0dead 100644 --- a/errpkg/error.go +++ b/errors/error.go @@ -1,4 +1,4 @@ -package errpkg +package errors type Error struct { err string diff --git a/filepkg/file.go b/files/file.go similarity index 95% rename from filepkg/file.go rename to files/file.go index f59cf67..862859f 100644 --- a/filepkg/file.go +++ b/files/file.go @@ -1,4 +1,4 @@ -package filepkg +package files import "os" diff --git a/httppkg/http.go b/https/http.go similarity index 90% rename from httppkg/http.go rename to https/http.go index 13a1c1b..1c540ec 100644 --- a/httppkg/http.go +++ b/https/http.go @@ -1,4 +1,4 @@ -package httppkg +package https import ( "io" @@ -6,13 +6,13 @@ import ( "net/http" "strings" - "github.com/pyihe/go-pkg/errpkg" + "github.com/pyihe/go-pkg/errors" "github.com/pyihe/go-pkg/serialize" ) var ( - ErrInvalidUrl = errpkg.New("url must start with 'http'") - ErrInvalidEncoder = errpkg.New("invalid encoder") + ErrInvalidUrl = errors.New("url must start with 'http'") + ErrInvalidEncoder = errors.New("invalid encoder") ) // Get 发起http get请求 diff --git a/httppkg/https.go b/https/https.go similarity index 99% rename from httppkg/https.go rename to https/https.go index 58602ad..23e673f 100644 --- a/httppkg/https.go +++ b/https/https.go @@ -1,4 +1,4 @@ -package httppkg +package https import ( "crypto/tls" diff --git a/listpkg/list_array.go b/lists/list_array.go similarity index 98% rename from listpkg/list_array.go rename to lists/list_array.go index ea1fa43..a4176e2 100644 --- a/listpkg/list_array.go +++ b/lists/list_array.go @@ -1,9 +1,9 @@ -package listpkg +package lists import ( "sync" - "github.com/pyihe/go-pkg/mathpkg" + "github.com/pyihe/go-pkg/maths" ) // ArrayList 切片实现的队列 @@ -41,7 +41,7 @@ func (array *ArrayList) LPush(elements ...interface{}) (n int) { func (array *ArrayList) LPop(n int) (data []interface{}) { array.mu.Lock() if count := len(array.data); count > 0 { - n = mathpkg.MinInt(n, count) + n = maths.MinInt(n, count) data, array.data = array.data[:n], array.data[n:] } array.mu.Unlock() @@ -101,7 +101,7 @@ func (array *ArrayList) RPush(elements ...interface{}) (n int) { func (array *ArrayList) RPop(n int) (data []interface{}) { array.mu.Lock() if count := len(array.data); count > 0 { - n = mathpkg.MinInt(n, count) + n = maths.MinInt(n, count) data, array.data = array.data[count-n:], array.data[:count-n] // 需要对结果进行倒序 for i := 0; i < n/2; i++ { diff --git a/listpkg/list_hash.go b/lists/list_hash.go similarity index 97% rename from listpkg/list_hash.go rename to lists/list_hash.go index b34c07c..3369b5d 100644 --- a/listpkg/list_hash.go +++ b/lists/list_hash.go @@ -1,10 +1,10 @@ -package listpkg +package lists import ( "container/list" "sync" - "github.com/pyihe/go-pkg/mathpkg" + "github.com/pyihe/go-pkg/maths" ) type HashList struct { @@ -327,8 +327,8 @@ func (hl *HashList) pop(front bool, n int, key interface{}) (elements []interfac } func handleIndex(length, start, end int) (int, int) { - start = mathpkg.MaxInt(mathpkg.MinInt(start, length), 0) - end = mathpkg.MaxInt(mathpkg.MinInt(end, length), 0) + start = maths.MaxInt(maths.MinInt(start, length), 0) + end = maths.MaxInt(maths.MinInt(end, length), 0) return start, end } diff --git a/listpkg/list_link.go b/lists/list_link.go similarity index 77% rename from listpkg/list_link.go rename to lists/list_link.go index 03ff595..e463efa 100644 --- a/listpkg/list_link.go +++ b/lists/list_link.go @@ -1,3 +1,3 @@ -package listpkg +package lists // 链表实现的队列, container/list内置的List diff --git a/listpkg/list_priority.go b/lists/list_priority.go similarity index 55% rename from listpkg/list_priority.go rename to lists/list_priority.go index a92d435..c8d5405 100644 --- a/listpkg/list_priority.go +++ b/lists/list_priority.go @@ -1,3 +1,3 @@ -package listpkg +package lists // 优先级队列 diff --git a/logpkg/log_log.go b/logs/log_log.go similarity index 98% rename from logpkg/log_log.go rename to logs/log_log.go index 5187588..e346fac 100644 --- a/logpkg/log_log.go +++ b/logs/log_log.go @@ -1,4 +1,4 @@ -package logpkg +package logs var ( logger Logger diff --git a/logpkg/log_option.go b/logs/log_option.go similarity index 99% rename from logpkg/log_option.go rename to logs/log_option.go index 0cafa99..714b5e8 100644 --- a/logpkg/log_option.go +++ b/logs/log_option.go @@ -1,4 +1,4 @@ -package logpkg +package logs // LogOption 日志配置项 type LogOption func(zl *zapLogger) diff --git a/logpkg/log_zap.go b/logs/log_zap.go similarity index 97% rename from logpkg/log_zap.go rename to logs/log_zap.go index 56763c9..cf0ba41 100644 --- a/logpkg/log_zap.go +++ b/logs/log_zap.go @@ -1,4 +1,4 @@ -package logpkg +package logs import ( "io" @@ -6,7 +6,7 @@ import ( "strings" "time" - "github.com/pyihe/go-pkg/netpkg" + "github.com/pyihe/go-pkg/nets" rotatelogs "github.com/lestrrat-go/file-rotatelogs" "go.uber.org/zap" @@ -57,7 +57,7 @@ func newZapLogger(opts ...LogOption) (Logger, error) { encoder := getJSONEncoder() - op := zap.Fields(zap.String("ip", netpkg.GetLocalIP()), zap.String("app", zlogger.name)) + op := zap.Fields(zap.String("ip", nets.GetLocalIP()), zap.String("app", zlogger.name)) options = append(options, op) allLevel := zap.LevelEnablerFunc(func(lv zapcore.Level) bool { diff --git a/mappkg/hash.go b/maps/hash.go similarity index 99% rename from mappkg/hash.go rename to maps/hash.go index 64c4ca6..e7102fe 100644 --- a/mappkg/hash.go +++ b/maps/hash.go @@ -1,4 +1,4 @@ -package mappkg +package maps import "sync" diff --git a/mappkg/kv.go b/maps/kv.go similarity index 86% rename from mappkg/kv.go rename to maps/kv.go index ada27ef..5a584f3 100644 --- a/mappkg/kv.go +++ b/maps/kv.go @@ -1,10 +1,10 @@ -package mappkg +package maps import ( "reflect" "strconv" - "github.com/pyihe/go-pkg/errpkg" + "github.com/pyihe/go-pkg/errors" ) type Param map[string]interface{} @@ -39,7 +39,7 @@ func (p Param) Range(fn func(key string, value interface{}) (breakOut bool)) { func (p Param) GetString(key string) (string, error) { value, ok := p.Get(key) if !ok { - return "", errpkg.New("not exist key: " + key) + return "", errors.New("not exist key: " + key) } return reflect.ValueOf(value).String(), nil } @@ -47,7 +47,7 @@ func (p Param) GetString(key string) (string, error) { func (p Param) GetInt64(key string) (n int64, err error) { value, ok := p.Get(key) if !ok { - return 0, errpkg.New("not exist key: " + key) + return 0, errors.New("not exist key: " + key) } t := reflect.TypeOf(value) v := reflect.ValueOf(value) @@ -65,7 +65,7 @@ func (p Param) GetInt64(key string) (n int64, err error) { case reflect.Float32, reflect.Float64: n = int64(v.Float()) default: - err = errpkg.New("unknown type: " + t.String()) + err = errors.New("unknown type: " + t.String()) } return } diff --git a/mappkg/map.go b/maps/map.go similarity index 99% rename from mappkg/map.go rename to maps/map.go index 59db30f..c42a73d 100644 --- a/mappkg/map.go +++ b/maps/map.go @@ -1,4 +1,4 @@ -package mappkg +package maps import "sync" diff --git a/mathpkg/factorial.go b/maths/factorial.go similarity index 99% rename from mathpkg/factorial.go rename to maths/factorial.go index e60006a..5e33f16 100644 --- a/mathpkg/factorial.go +++ b/maths/factorial.go @@ -1,4 +1,4 @@ -package mathpkg +package maths func factorial(m int) (n int) { n = 1 diff --git a/mathpkg/math.go b/maths/math.go similarity index 97% rename from mathpkg/math.go rename to maths/math.go index e82373d..2ac6d0a 100644 --- a/mathpkg/math.go +++ b/maths/math.go @@ -1,4 +1,4 @@ -package mathpkg +package maths func MaxInt(a, b int) int { if a > b { diff --git a/monitorpkg/file.go b/monitor/file.go similarity index 97% rename from monitorpkg/file.go rename to monitor/file.go index 527fb15..72e6831 100644 --- a/monitorpkg/file.go +++ b/monitor/file.go @@ -1,4 +1,4 @@ -package monitorpkg +package monitor import ( "os" diff --git a/monitorpkg/monitor.go b/monitor/monitor.go similarity index 98% rename from monitorpkg/monitor.go rename to monitor/monitor.go index adf7d46..dc38542 100644 --- a/monitorpkg/monitor.go +++ b/monitor/monitor.go @@ -1,4 +1,4 @@ -package monitorpkg +package monitor import ( "errors" diff --git a/netpkg/net.go b/nets/net.go similarity index 99% rename from netpkg/net.go rename to nets/net.go index 49c90bf..afe40eb 100644 --- a/netpkg/net.go +++ b/nets/net.go @@ -1,4 +1,4 @@ -package netpkg +package nets import ( "net" diff --git a/pointerpkg/ptr.go b/ptrs/ptr.go similarity index 98% rename from pointerpkg/ptr.go rename to ptrs/ptr.go index c67eef2..8b68fce 100644 --- a/pointerpkg/ptr.go +++ b/ptrs/ptr.go @@ -1,4 +1,4 @@ -package pointerpkg +package ptrs /* 返回各种基本数据类型的指针 diff --git a/randpkg/rand.go b/rands/rand.go similarity index 95% rename from randpkg/rand.go rename to rands/rand.go index 3e8acde..a47427a 100644 --- a/randpkg/rand.go +++ b/rands/rand.go @@ -1,10 +1,10 @@ -package randpkg +package rands import ( "math/rand" "time" - "github.com/pyihe/go-pkg/bytepkg" + "github.com/pyihe/go-pkg/bytes" ) const ( @@ -74,7 +74,7 @@ func String(n int) string { cache >>= letterIdxBits remain-- } - return bytepkg.String(b) + return bytes.String(b) } // ShuffleBytes shuffle 随机算法 diff --git a/redispkg/conn.go b/rediss/conn.go similarity index 97% rename from redispkg/conn.go rename to rediss/conn.go index 6fa1e87..8f617ee 100644 --- a/redispkg/conn.go +++ b/rediss/conn.go @@ -1,16 +1,16 @@ -package redispkg +package rediss import ( "github.com/garyburd/redigo/redis" - "github.com/pyihe/go-pkg/errpkg" + "github.com/pyihe/go-pkg/errors" "github.com/pyihe/go-pkg/serialize" ) var ( - ErrInvalidKey = errpkg.New("invalid key") - ErrInvalidEncoder = errpkg.New("not figure encoder") - ErrInvalidConn = errpkg.New("invalid redis conn") - ErrInvalidParamNum = errpkg.New("invalid param num") + ErrInvalidKey = errors.New("invalid key") + ErrInvalidEncoder = errors.New("not figure encoder") + ErrInvalidConn = errors.New("invalid redis conn") + ErrInvalidParamNum = errors.New("invalid param num") ) type myRedisConn struct { diff --git a/redispkg/hash.go b/rediss/hash.go similarity index 97% rename from redispkg/hash.go rename to rediss/hash.go index 54747b6..c0762e4 100644 --- a/redispkg/hash.go +++ b/rediss/hash.go @@ -1,4 +1,4 @@ -package redispkg +package rediss func (conn *myRedisConn) HGet(key string, field string) ([]byte, error) { value, err := conn.hGet(key, field) diff --git a/redispkg/list.go b/rediss/list.go similarity index 97% rename from redispkg/list.go rename to rediss/list.go index e87e81f..820d606 100644 --- a/redispkg/list.go +++ b/rediss/list.go @@ -1,4 +1,4 @@ -package redispkg +package rediss func (conn *myRedisConn) RPush(key string, values ...interface{}) error { err := conn.rpush(key, values...) diff --git a/redispkg/pool.go b/rediss/pool.go similarity index 98% rename from redispkg/pool.go rename to rediss/pool.go index 055b9b4..9b08931 100644 --- a/redispkg/pool.go +++ b/rediss/pool.go @@ -1,4 +1,4 @@ -package redispkg +package rediss import ( "fmt" @@ -105,7 +105,7 @@ func NewPool(opts ...InitOptions) (RedisPool, error) { op(defaultPool) } if defaultPool.addr == "" { - return nil, fmt.Errorf("no redispkg address") + return nil, fmt.Errorf("no rediss address") } if defaultPool.db == 0 { defaultPool.db = 1 diff --git a/redispkg/set.go b/rediss/set.go similarity index 96% rename from redispkg/set.go rename to rediss/set.go index 4151f1d..780a385 100644 --- a/redispkg/set.go +++ b/rediss/set.go @@ -1,4 +1,4 @@ -package redispkg +package rediss func (conn *myRedisConn) SADD(key string, members ...interface{}) error { err := conn.sAdd(key, members...) diff --git a/redispkg/string.go b/rediss/string.go similarity index 98% rename from redispkg/string.go rename to rediss/string.go index 51a47ee..5709078 100644 --- a/redispkg/string.go +++ b/rediss/string.go @@ -1,4 +1,4 @@ -package redispkg +package rediss func (conn *myRedisConn) GetKeys(pattern string) (keys []string, err error) { keys, err = conn.getKeys(pattern) diff --git a/slicepkg/float32.go b/slices/float32.go similarity index 97% rename from slicepkg/float32.go rename to slices/float32.go index e6fe39f..d773006 100644 --- a/slicepkg/float32.go +++ b/slices/float32.go @@ -1,9 +1,9 @@ -package slicepkg +package slices import ( "fmt" - "github.com/pyihe/go-pkg/sortpkg" + "github.com/pyihe/go-pkg/sorts" ) type float32Slice []float32 @@ -38,7 +38,7 @@ func (f *float32Slice) Sort() { if f == nil { return } - sortpkg.SortFloat32s(*f) + sorts.SortFloat32s(*f) } func (f *float32Slice) PushBack(x interface{}) (bool, int) { diff --git a/slicepkg/float64.go b/slices/float64.go similarity index 97% rename from slicepkg/float64.go rename to slices/float64.go index 8930455..76d1e38 100644 --- a/slicepkg/float64.go +++ b/slices/float64.go @@ -1,9 +1,9 @@ -package slicepkg +package slices import ( "fmt" - "github.com/pyihe/go-pkg/sortpkg" + "github.com/pyihe/go-pkg/sorts" ) type float64Slice []float64 @@ -38,7 +38,7 @@ func (f *float64Slice) Sort() { if f == nil { return } - sortpkg.SortFloat64s(*f) + sorts.SortFloat64s(*f) } func (f *float64Slice) PushBack(x interface{}) (bool, int) { diff --git a/slicepkg/int.go b/slices/int.go similarity index 97% rename from slicepkg/int.go rename to slices/int.go index 9e31df9..b949ce1 100644 --- a/slicepkg/int.go +++ b/slices/int.go @@ -1,9 +1,9 @@ -package slicepkg +package slices import ( "fmt" - "github.com/pyihe/go-pkg/sortpkg" + "github.com/pyihe/go-pkg/sorts" ) type intSlice []int @@ -38,7 +38,7 @@ func (is *intSlice) Sort() { if is == nil { return } - sortpkg.SortInts(*is) + sorts.SortInts(*is) } func (is *intSlice) PushBack(x interface{}) (bool, int) { diff --git a/slicepkg/int16.go b/slices/int16.go similarity index 97% rename from slicepkg/int16.go rename to slices/int16.go index 5bfc8f9..ac1d68b 100644 --- a/slicepkg/int16.go +++ b/slices/int16.go @@ -1,9 +1,9 @@ -package slicepkg +package slices import ( "fmt" - "github.com/pyihe/go-pkg/sortpkg" + "github.com/pyihe/go-pkg/sorts" ) type int16Slice []int16 @@ -38,7 +38,7 @@ func (i16 *int16Slice) Sort() { if i16 == nil { return } - sortpkg.SortInt16s(*i16) + sorts.SortInt16s(*i16) } func (i16 *int16Slice) PushBack(x interface{}) (bool, int) { diff --git a/slicepkg/int32.go b/slices/int32.go similarity index 97% rename from slicepkg/int32.go rename to slices/int32.go index ee93ca5..7204f86 100644 --- a/slicepkg/int32.go +++ b/slices/int32.go @@ -1,9 +1,9 @@ -package slicepkg +package slices import ( "fmt" - "github.com/pyihe/go-pkg/sortpkg" + "github.com/pyihe/go-pkg/sorts" ) type int32Slice []int32 @@ -38,7 +38,7 @@ func (i32 *int32Slice) Sort() { if i32 == nil { return } - sortpkg.SortInt32s(*i32) + sorts.SortInt32s(*i32) } func (i32 *int32Slice) PushBack(x interface{}) (bool, int) { diff --git a/slicepkg/int64.go b/slices/int64.go similarity index 97% rename from slicepkg/int64.go rename to slices/int64.go index 747281e..7c1a123 100644 --- a/slicepkg/int64.go +++ b/slices/int64.go @@ -1,9 +1,9 @@ -package slicepkg +package slices import ( "fmt" - "github.com/pyihe/go-pkg/sortpkg" + "github.com/pyihe/go-pkg/sorts" ) type int64Slice []int64 @@ -38,7 +38,7 @@ func (i64 *int64Slice) Sort() { if i64 == nil { return } - sortpkg.SortInt64s(*i64) + sorts.SortInt64s(*i64) } func (i64 *int64Slice) PushBack(x interface{}) (bool, int) { diff --git a/slicepkg/int8.go b/slices/int8.go similarity index 97% rename from slicepkg/int8.go rename to slices/int8.go index 328399d..0348595 100644 --- a/slicepkg/int8.go +++ b/slices/int8.go @@ -1,9 +1,9 @@ -package slicepkg +package slices import ( "fmt" - "github.com/pyihe/go-pkg/sortpkg" + "github.com/pyihe/go-pkg/sorts" ) type int8Slice []int8 @@ -38,7 +38,7 @@ func (i8 *int8Slice) Sort() { if i8 == nil { return } - sortpkg.SortInt8s(*i8) + sorts.SortInt8s(*i8) } func (i8 *int8Slice) PushBack(x interface{}) (bool, int) { diff --git a/slicepkg/sli.go b/slices/sli.go similarity index 99% rename from slicepkg/sli.go rename to slices/sli.go index 7124ad7..68ed705 100644 --- a/slicepkg/sli.go +++ b/slices/sli.go @@ -1,4 +1,4 @@ -package slicepkg +package slices import ( "fmt" diff --git a/slicepkg/string.go b/slices/string.go similarity index 97% rename from slicepkg/string.go rename to slices/string.go index 5797ac3..0a3f1ad 100644 --- a/slicepkg/string.go +++ b/slices/string.go @@ -1,9 +1,9 @@ -package slicepkg +package slices import ( "fmt" - "github.com/pyihe/go-pkg/sortpkg" + "github.com/pyihe/go-pkg/sorts" ) type stringSlice []string @@ -38,7 +38,7 @@ func (ss *stringSlice) Sort() { if ss == nil { return } - sortpkg.SortStrings(*ss) + sorts.SortStrings(*ss) } func (ss *stringSlice) PushBack(x interface{}) (bool, int) { diff --git a/slicepkg/uint.go b/slices/uint.go similarity index 97% rename from slicepkg/uint.go rename to slices/uint.go index d3c1df8..10d71f5 100644 --- a/slicepkg/uint.go +++ b/slices/uint.go @@ -1,9 +1,9 @@ -package slicepkg +package slices import ( "fmt" - "github.com/pyihe/go-pkg/sortpkg" + "github.com/pyihe/go-pkg/sorts" ) type uintSlice []uint @@ -38,7 +38,7 @@ func (us *uintSlice) Sort() { if us == nil { return } - sortpkg.SortUints(*us) + sorts.SortUints(*us) } func (us *uintSlice) PushBack(x interface{}) (bool, int) { diff --git a/slicepkg/uint16.go b/slices/uint16.go similarity index 97% rename from slicepkg/uint16.go rename to slices/uint16.go index 357650e..169dead 100644 --- a/slicepkg/uint16.go +++ b/slices/uint16.go @@ -1,9 +1,9 @@ -package slicepkg +package slices import ( "fmt" - "github.com/pyihe/go-pkg/sortpkg" + "github.com/pyihe/go-pkg/sorts" ) type uint16Slice []uint16 @@ -38,7 +38,7 @@ func (u16 *uint16Slice) Sort() { if u16 == nil { return } - sortpkg.SortUint16s(*u16) + sorts.SortUint16s(*u16) } func (u16 *uint16Slice) PushBack(x interface{}) (bool, int) { diff --git a/slicepkg/uint32.go b/slices/uint32.go similarity index 97% rename from slicepkg/uint32.go rename to slices/uint32.go index 82b68a1..a4e133d 100644 --- a/slicepkg/uint32.go +++ b/slices/uint32.go @@ -1,9 +1,9 @@ -package slicepkg +package slices import ( "fmt" - "github.com/pyihe/go-pkg/sortpkg" + "github.com/pyihe/go-pkg/sorts" ) type uint32Slice []uint32 @@ -38,7 +38,7 @@ func (i32 *uint32Slice) Sort() { if i32 == nil { return } - sortpkg.SortUint32s(*i32) + sorts.SortUint32s(*i32) } func (i32 *uint32Slice) PushBack(x interface{}) (bool, int) { diff --git a/slicepkg/uint64.go b/slices/uint64.go similarity index 97% rename from slicepkg/uint64.go rename to slices/uint64.go index eb1f8e3..507ab61 100644 --- a/slicepkg/uint64.go +++ b/slices/uint64.go @@ -1,9 +1,9 @@ -package slicepkg +package slices import ( "fmt" - "github.com/pyihe/go-pkg/sortpkg" + "github.com/pyihe/go-pkg/sorts" ) type uint64Slice []uint64 @@ -38,7 +38,7 @@ func (i64 *uint64Slice) Sort() { if i64 == nil { return } - sortpkg.SortUint64s(*i64) + sorts.SortUint64s(*i64) } func (i64 *uint64Slice) PushBack(x interface{}) (bool, int) { diff --git a/slicepkg/uint8.go b/slices/uint8.go similarity index 97% rename from slicepkg/uint8.go rename to slices/uint8.go index f7aac66..b23a457 100644 --- a/slicepkg/uint8.go +++ b/slices/uint8.go @@ -1,9 +1,9 @@ -package slicepkg +package slices import ( "fmt" - "github.com/pyihe/go-pkg/sortpkg" + "github.com/pyihe/go-pkg/sorts" ) type uint8Slice []uint8 @@ -38,7 +38,7 @@ func (i8 *uint8Slice) Sort() { if i8 == nil { return } - sortpkg.SortUint8s(*i8) + sorts.SortUint8s(*i8) } func (i8 *uint8Slice) PushBack(x interface{}) (bool, int) { diff --git a/sortpkg/sli.go b/sorts/sli.go similarity index 99% rename from sortpkg/sli.go rename to sorts/sli.go index 49b3855..7b34467 100644 --- a/sortpkg/sli.go +++ b/sorts/sli.go @@ -1,4 +1,4 @@ -package sortpkg +package sorts import "sort" diff --git a/sortpkg/sort.go b/sorts/sort.go similarity index 98% rename from sortpkg/sort.go rename to sorts/sort.go index d771cfb..b704401 100644 --- a/sortpkg/sort.go +++ b/sorts/sort.go @@ -1,4 +1,4 @@ -package sortpkg +package sorts import ( "sort" diff --git a/stringpkg/strings.go b/strings/strings.go similarity index 99% rename from stringpkg/strings.go rename to strings/strings.go index a382ec1..691e862 100644 --- a/stringpkg/strings.go +++ b/strings/strings.go @@ -1,4 +1,4 @@ -package stringpkg +package strings import ( "reflect" diff --git a/syncpkg/counter.go b/syncs/counter.go similarity index 93% rename from syncpkg/counter.go rename to syncs/counter.go index 4c4e0a7..9e7ad07 100644 --- a/syncpkg/counter.go +++ b/syncs/counter.go @@ -1,4 +1,4 @@ -package syncpkg +package syncs import ( "sync/atomic" diff --git a/timepkg/timer.go b/times/timer.go similarity index 98% rename from timepkg/timer.go rename to times/timer.go index 1ed5efa..fd80712 100644 --- a/timepkg/timer.go +++ b/times/timer.go @@ -1,4 +1,4 @@ -package timepkg +package times import "time" diff --git a/zippkg/zip.go b/zips/zip.go similarity index 98% rename from zippkg/zip.go rename to zips/zip.go index 5856901..7f61317 100644 --- a/zippkg/zip.go +++ b/zips/zip.go @@ -1,4 +1,4 @@ -package zippkg +package zips import ( "bytes"