Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/jefferyjob/go-easy-utils
Quick toolbox for common data processing developed by Go language。Go语言开发的常用数据处理的快捷工具箱。
https://github.com/jefferyjob/go-easy-utils
go go-easy-utils utils
Last synced: 1 day ago
JSON representation
Quick toolbox for common data processing developed by Go language。Go语言开发的常用数据处理的快捷工具箱。
- Host: GitHub
- URL: https://github.com/jefferyjob/go-easy-utils
- Owner: jefferyjob
- License: apache-2.0
- Created: 2023-03-06T09:17:06.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-08-20T10:56:49.000Z (3 months ago)
- Last Synced: 2024-08-21T09:34:03.753Z (3 months ago)
- Topics: go, go-easy-utils, utils
- Language: Go
- Homepage:
- Size: 288 KB
- Stars: 331
- Watchers: 6
- Forks: 24
- Open Issues: 0
-
Metadata Files:
- Readme: README.cn.md
- Changelog: CHANGELOG.cn.md
- License: LICENSE
Awesome Lists containing this project
README
# go-easy-utils
[![Go](https://img.shields.io/badge/Go->=1.18-green)](https://go.dev)
[![Release](https://img.shields.io/github/v/release/jefferyjob/go-easy-utils.svg)](https://github.com/jefferyjob/go-easy-utils/releases)
[![Action](https://github.com/jefferyjob/go-easy-utils/workflows/Go/badge.svg?branch=main)](https://github.com/jefferyjob/go-easy-utils/actions)
[![Report](https://goreportcard.com/badge/github.com/jefferyjob/go-easy-utils)](https://goreportcard.com/report/github.com/jefferyjob/go-easy-utils)
[![Coverage](https://codecov.io/gh/jefferyjob/go-easy-utils/branch/main/graph/badge.svg)](https://codecov.io/gh/jefferyjob/go-easy-utils)
[![Doc](https://img.shields.io/badge/go.dev-reference-brightgreen?logo=go&logoColor=white&style=flat)](https://pkg.go.dev/github.com/jefferyjob/go-easy-utils/v2)
[![License](https://img.shields.io/github/license/jefferyjob/go-easy-utils)](https://github.com/jefferyjob/go-easy-utils/blob/main/LICENSE)[English](README.md) | 简体中文
## 介绍
这是一个基于 Go 语言开发的通用数据类型处理工具类,帮助开发者在业务代码实现中处理常见的数据类型和数据操作。可以让您专注于您的业务代码的实现,而免去处理基本数据类型转换和验证的功能。该工具库无侵入式的设计可以让您的业务代码更容易阅读和优雅。## 快速开始
**安装**使用 `Go1.18` 及以上版本的用户,建议安装 `v2.x.x`。 因为 `v2.x.x` 应用 `Go1.18` 的泛型重写了大部分函数。
```bash
go get -u github.com/jefferyjob/go-easy-utils/v2
```使用 `Go1.18` 以下版本的用户,请使用 [v1.x](https://github.com/jefferyjob/go-easy-utils/tree/v1) 版本
**使用Demo**
```go
package mainimport (
"fmt"
"github.com/jefferyjob/go-easy-utils/v2/sliceUtil"
)func main() {
var slice = []string{"this", "is", "go", "easy", "utils"}
chunkSlice := sliceUtil.ChunkSlice(slice, 2)
fmt.Printf("%v", chunkSlice)
}
```## 功能列表
| 包名 | 函数概要 | 文档 |
|--------------| ----------------------------------------------------------------------------------------- |----------------------|
| anyUtil | 将任意类型的数据转换为指定类型 | [README](anyUtil) |
| byteUtil | 字节数组转换 | [README](byteUtil) |
| cryptoUtil | 各种加密处理 | [README](cryptoUtil) |
| emojiUtil | 表情符号的解码和编码 | [README](emojiUtil) |
| floatUtil | 浮点数数据处理 | [README](floatUtil) |
| intUtil | 数值数据处理 | [README](intUtil) |
| jsonUtil | JSON 数据转换,支持弱类型转换 | [README](jsonUtil) |
| mapUtil | Map 类型数据处理 | [README](mapUtil) |
| mathUtil | 数学函数可以处理整数和浮点数范围内的值 | [README](mathUtil) |
| randUtil | 随机数生成,包括:数字、字符串、字节数组 | [README](randUtil) |
| sliceUtil | 切片处理(分组、求和、转换、合并等) | [README](sliceUtil) |
| strUtil | 字符串转换处理 | [README](strUtil) |
| validUtil | 常见数据验证,如:中文、英文、姓名、身份证号、电话号码、电子邮件 | [README](validUtil) |## 许可证
本库采用 Apache-2.0 进行授权。有关详细信息,请参阅 LICENSE 文件。