From bb03f31a8b456c17ffef54e69985ad24fd6db92a Mon Sep 17 00:00:00 2001 From: dudaodong Date: Wed, 16 Mar 2022 19:16:43 +0800 Subject: [PATCH] release v2.0.0 --- README.md | 16 +++++++++++----- README_zh-CN.md | 17 ++++++++++++----- 2 files changed, 23 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index abd05f2..a910044 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@
![Go version](https://img.shields.io/badge/go-%3E%3D1.16-9cf) -[![Release](https://img.shields.io/badge/release-1.2.6-green.svg)](https://github.com/duke-git/lancet/releases) +[![Release](https://img.shields.io/badge/release-2.0.0-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) [![Go Report Card](https://goreportcard.com/badge/github.com/duke-git/lancet)](https://goreportcard.com/report/github.com/duke-git/lancet) [![test](https://github.com/duke-git/lancet/actions/workflows/codecov.yml/badge.svg?branch=main&event=push)](https://github.com/duke-git/lancet/actions/workflows/codecov.yml) @@ -24,14 +24,21 @@ English | [简体中文](./README_zh-CN.md) ## Feature - 👏 Comprehensive, efficient and reusable. -- 💪 180+ go util functions, support string, slice, datetime, net, crypt... +- 💪 250+ go util functions, support string, slice, datetime, net, crypt... - 💅 Only depend on the go standard library. - 🌍 Unit test for every exported function. ## Installation +note: +1. For users who use go1.18 and above, it is recommended to install lancet v2.x.x. Cause v2.x.x rewrite all functions with generics of go1.18. Default installation will be latest version of v2.x.x ```go -go get github.com/duke-git/lancet +go get github.com/duke-git/lancet // Default installation will be latest version of v2.x.x +``` + +2. For users who use version below go1.18, you should install v1.x.x. now latest v1 is v1.2.6. +```go +go get github.com/duke-git/lancet@1.2.6 // below go1.18, install latest version of v1.x.x ``` ## Usage @@ -390,8 +397,7 @@ import "github.com/duke-git/lancet/validator" - [IsStrongPassword](https://github.com/duke-git/lancet/blob/main/docs/validator.md#IsStrongPassword) - [IsUrl](https://github.com/duke-git/lancet/blob/main/docs/validator.md#IsUrl) - [IsWeakPassword](https://github.com/duke-git/lancet/blob/main/docs/validator.md#IsWeakPassword) -### 14. xerror -xerror package implements helpers for errors. +### xerror package implements helpers for errors. ```go import "github.com/duke-git/lancet/xerror" diff --git a/README_zh-CN.md b/README_zh-CN.md index 0973c77..6b29945 100644 --- a/README_zh-CN.md +++ b/README_zh-CN.md @@ -4,7 +4,7 @@
![Go version](https://img.shields.io/badge/go-%3E%3D1.16-9cf) -[![Release](https://img.shields.io/badge/release-1.2.6-green.svg)](https://github.com/duke-git/lancet/releases) +[![Release](https://img.shields.io/badge/release-2.0.0-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) [![Go Report Card](https://goreportcard.com/badge/github.com/duke-git/lancet)](https://goreportcard.com/report/github.com/duke-git/lancet) [![test](https://github.com/duke-git/lancet/actions/workflows/codecov.yml/badge.svg?branch=main&event=push)](https://github.com/duke-git/lancet/actions/workflows/codecov.yml) @@ -24,14 +24,22 @@ ## 特性 - 👏 全面、高效、可复用 -- 💪 180+常用go工具函数,支持string、slice、datetime、net、crypt... +- 💪 250+常用go工具函数,支持string、slice、datetime、net、crypt... - 💅 只依赖go标准库 - 🌍 所有导出函数单元测试覆盖率100% ## 安装 +note: +1. 对于使用go1.18及以上的用户,建议安装lancet v2.x.x。 因为v2.x.x用go1.18的泛型重写了所有函数。 默认安装将是最新版本的v2.x.x + ```go -go get github.com/duke-git/lancet +go get github.com/duke-git/lancet //默认安装最新版本的v2.x.x +``` + +2. 使用go1.18以下版本的用户,必须安装v1.x.x。 目前最新的v1版本是v1.2.6。 +```go +go get github.com/duke-git/lancet@1.2.6 // 使用go1.18以下版本, 必须按照v1最新版本 ``` ## 用法 @@ -393,8 +401,7 @@ import "github.com/duke-git/lancet/validator" - [IsWeakPassword](https://github.com/duke-git/lancet/blob/main/docs/validator_zh-CN.md#IsWeakPassword) validator.md#IsWeakPassword) -### 14. xerror -xerror包实现一些错误处理函数 +### xerror包实现一些错误处理函数 ```go import "github.com/duke-git/lancet/xerror"