Lancet is a comprehensive, efficient, and reusable util function library of go. Inspired by the java apache common package and lodash.js.
## Website | [็ฎไฝไธญๆ](./README_zh-CN.md) ## Feature - ๐ Comprehensive, efficient and reusable. - ๐ช 600+ go util functions, support string, slice, datetime, net, crypt... - ๐ Only depends on two kinds of libraries: go standard library and golang.org/x. - ๐ 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 in v2.x.x all functions was rewriten with generics of go1.18. ```go go get github.com/duke-git/lancet/v2 // will install latest version of v2.x.x ``` 2. For users who use version below go1.18, you should install v1.x.x. The latest of v1.x.x is v1.4.1. ```go go get github.com/duke-git/lancet // below go1.18, install latest version of v1.x.x ``` ## Usage Lancet organizes the code into package structure, and you need to import the corresponding package name when use it. For example, if you use string-related functions,import the strutil package like below: ```go import "github.com/duke-git/lancet/v2/strutil" ``` ## Example Here takes the string function Reverse (reverse order string) as an example, and the strutil package needs to be imported. ```go package main import ( "fmt" "github.com/duke-git/lancet/v2/strutil" ) func main() { s := "hello" rs := strutil.Reverse(s) fmt.Println(rs) //olleh } ``` ## Documentation ### Index - [Algorithm](#user-content-algorithm) - [Compare](#user-content-compare) - [Concurrency](#user-content-concurrency) - [Condition](#user-content-condition) - [Convertor](#user-content-convertor) - [Cryptor](#user-content-cryptor) - [Datetime](#user-content-datetime) - [Datastructure](#user-content-datastructure) - [Fileutil](#user-content-fileutil) - [Formatter](#user-content-formatter) - [Function](#user-content-function) - [Maputil](#user-content-maputil) - [Mathutil](#user-content-mathutil) - [Netutil](#user-content-netutil) - [Pointer](#user-content-pointer) - [Random](#user-content-random) - [Retry](#user-content-retry) - [Slice](#user-content-slice) - [Stream](#user-content-stream) - [Structs](#user-content-structs) - [Strutil](#user-content-strutil) - [System](#user-content-system) - [Tuple](#user-content-tuple) - [Validator](#user-content-validator) - [Xerror](#user-content-xerror)