mirror of
				https://github.com/pyihe/go-pkg.git
				synced 2025-10-31 11:17:13 +08:00 
			
		
		
		
	fix
This commit is contained in:
		| @@ -7,6 +7,14 @@ import ( | |||||||
| 	"github.com/pyihe/go-pkg/errors" | 	"github.com/pyihe/go-pkg/errors" | ||||||
| ) | ) | ||||||
|  |  | ||||||
|  | func Copy(src []byte) (b []byte) { | ||||||
|  | 	if len(src) > 0 { | ||||||
|  | 		b = make([]byte, len(src)) | ||||||
|  | 		copy(b, src) | ||||||
|  | 	} | ||||||
|  | 	return | ||||||
|  | } | ||||||
|  |  | ||||||
| func Int64(b []byte) (v int64, err error) { | func Int64(b []byte) (v int64, err error) { | ||||||
| 	if len(b) == 0 { | 	if len(b) == 0 { | ||||||
| 		return | 		return | ||||||
|   | |||||||
| @@ -57,7 +57,7 @@ func newZapLogger(opts ...LogOption) (Logger, error) { | |||||||
|  |  | ||||||
| 	encoder := getJSONEncoder() | 	encoder := getJSONEncoder() | ||||||
|  |  | ||||||
| 	op := zap.Fields(zap.String("ip", nets.GetLocalIP()), zap.String("app", zlogger.name)) | 	op := zap.Fields(zap.String("ip", nets.LocalIP()), zap.String("app", zlogger.name)) | ||||||
| 	options = append(options, op) | 	options = append(options, op) | ||||||
|  |  | ||||||
| 	allLevel := zap.LevelEnablerFunc(func(lv zapcore.Level) bool { | 	allLevel := zap.LevelEnablerFunc(func(lv zapcore.Level) bool { | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 pyihe
					pyihe