1
0
mirror of https://github.com/duke-git/lancet.git synced 2026-02-08 14:42:27 +08:00

Compare commits

...

6 Commits

Author SHA1 Message Date
dudaodong
2e04a41f34 update version 2021-12-01 11:34:53 +08:00
dudaodong
acb7873832 fix: setQueryParam failed in request_util.go 2021-12-01 11:34:18 +08:00
dudaodong
8b3cc3266d fix misspel in README_zh-CN.md 2021-11-30 09:51:21 +08:00
dudaodong
62c570d29b update version 2021-11-29 20:24:28 +08:00
dudaodong
4e5d3c2603 fix: fix IsExist function in fileutil/file.go 2021-11-29 20:23:26 +08:00
dudaodong
561b590e13 update: fix misspell in readme file 2021-11-29 20:02:55 +08:00
5 changed files with 9 additions and 9 deletions

View File

@@ -6,7 +6,7 @@
<div align="center" style="text-align: center;"> <div align="center" style="text-align: center;">
![Go version](https://img.shields.io/badge/go-%3E%3D1.16<recommend>-9cf) ![Go version](https://img.shields.io/badge/go-%3E%3D1.16<recommend>-9cf)
[![Release](https://img.shields.io/badge/release-1.0.3-green.svg)](https://github.com/duke-git/lancet/releases) [![Release](https://img.shields.io/badge/release-1.0.5-green.svg)](https://github.com/duke-git/lancet/releases)
[![GoDoc](https://godoc.org/github.com//duke-git/lancet?status.svg)](https://pkg.go.dev/github.com/duke-git/lancet) [![GoDoc](https://godoc.org/github.com//duke-git/lancet?status.svg)](https://pkg.go.dev/github.com/duke-git/lancet)
[![Go Report Card](https://goreportcard.com/badge/github.com/duke-git/lancet)](https://goreportcard.com/report/github.com/duke-git/lancet) [![Go Report Card](https://goreportcard.com/badge/github.com/duke-git/lancet)](https://goreportcard.com/report/github.com/duke-git/lancet)
[![codecov](https://codecov.io/gh/duke-git/lancet/branch/main/graph/badge.svg?token=FC48T1F078)](https://codecov.io/gh/duke-git/lancet) [![codecov](https://codecov.io/gh/duke-git/lancet/branch/main/graph/badge.svg?token=FC48T1F078)](https://codecov.io/gh/duke-git/lancet)

View File

@@ -6,7 +6,7 @@
<div align="center" style="text-align: center;"> <div align="center" style="text-align: center;">
![Go version](https://img.shields.io/badge/go-%3E%3D1.16<recommend>-9cf) ![Go version](https://img.shields.io/badge/go-%3E%3D1.16<recommend>-9cf)
[![Release](https://img.shields.io/badge/release-1.0.3-green.svg)](https://github.com/duke-git/lancet/releases) [![Release](https://img.shields.io/badge/release-1.0.5-green.svg)](https://github.com/duke-git/lancet/releases)
[![GoDoc](https://godoc.org/github.com//duke-git/lancet?status.svg)](https://pkg.go.dev/github.com/duke-git/lancet) [![GoDoc](https://godoc.org/github.com//duke-git/lancet?status.svg)](https://pkg.go.dev/github.com/duke-git/lancet)
[![Go Report Card](https://goreportcard.com/badge/github.com/duke-git/lancet)](https://goreportcard.com/report/github.com/duke-git/lancet) [![Go Report Card](https://goreportcard.com/badge/github.com/duke-git/lancet)](https://goreportcard.com/report/github.com/duke-git/lancet)
[![codecov](https://codecov.io/gh/duke-git/lancet/branch/main/graph/badge.svg?token=FC48T1F078)](https://codecov.io/gh/duke-git/lancet) [![codecov](https://codecov.io/gh/duke-git/lancet/branch/main/graph/badge.svg?token=FC48T1F078)](https://codecov.io/gh/duke-git/lancet)
@@ -23,7 +23,7 @@
- 👏 全面、高效、可复用 - 👏 全面、高效、可复用
- 💪 100+常用go工具函数支持string、slice、datetime、net、crypt... - 💪 100+常用go工具函数支持string、slice、datetime、net、crypt...
- 💅 只依赖go标准库 - 💅 只依赖go标准库
- 🌍 所有导出函数单测试覆盖率100% - 🌍 所有导出函数单测试覆盖率100%
### 安装 ### 安装
@@ -63,7 +63,7 @@ func main() {
#### 1. convertor数据转换包 #### 1. convertor数据转换包
- 转换函数支持常用数据类型之间的转换 - 转换函数支持常用数据类型之间的转换
- 导入包import "github.com/duke-git/lancet/cryptor" - 导入包import "github.com/duke-git/lancet/convertor"
```go ```go
package main package main
@@ -100,7 +100,7 @@ func StructToMap(value interface{}) (map[string]interface{}, error) //struct串
#### 2. cryptor加解密包 #### 2. cryptor加解密包
- 加密函数支持md5, hmac, aes, des, ras - 加密函数支持md5, hmac, aes, des, ras
- 导入包import "github.com/duke-git/lancet/cryptor" - 导入包import "github.com/duke-git/lancet/cryptor"
```go ```go

View File

@@ -17,7 +17,7 @@ func IsExist(path string) bool {
if err == nil { if err == nil {
return true return true
} }
if errors.Is(err, os.ErrExist) { if errors.Is(err, os.ErrNotExist) {
return false return false
} }
return false return false

View File

@@ -9,8 +9,8 @@ import (
) )
func TestIsExist(t *testing.T) { func TestIsExist(t *testing.T) {
cases := []string{"./", "./a.txt"} cases := []string{"./", "./file.go", "./a.txt"}
expected := []bool{true, false} expected := []bool{true, true, false}
for i := 0; i < len(cases); i++ { for i := 0; i < len(cases); i++ {
res := IsExist(cases[i]) res := IsExist(cases[i])

View File

@@ -124,7 +124,7 @@ func setQueryParam(req *http.Request, reqUrl string, queryParam interface{}) err
case map[string]interface{}: case map[string]interface{}:
values = url.Values{} values = url.Values{}
for k := range v { for k := range v {
values.Set(k, fmt.Sprintf("%s", v[k])) values.Set(k, fmt.Sprintf("%v", v[k]))
} }
case url.Values: case url.Values:
values = v values = v