Skip to main content

Goutil 版本更新日志

gookit/goutil Go 常用功能的扩展工具库。包含:数字,字符串,slice/数组,Map,结构体,反射,文本,文件,错误,时间日期,测试,CLI,命令运行,系统信息,格式化,常用信息获取等等。

功能特点

基础工具包

  • arrutil array/slice 相关操作的函数工具包 如:类型转换,元素检查等等
  • cliutil CLI 的一些工具函数包. eg: read input, exec command
    • cliutil/cmdline 提供 cmdline 解析,args 构建到 cmdline
  • envutil ENV 信息获取判断工具包. eg: get one, get info, parse var
  • fmtutil 格式化数据工具函数 eg:数据size
  • fsutil 文件系统操作相关的工具函数包. eg: file and dir check, operate
  • goinfo 提供一些与Go info, runtime 相关的工具函数。
  • jsonutil 一些用于快速读取、写入、编码、解码 JSON 数据的实用函数。
  • maputil map 相关操作的函数工具包. eg: convert, sub-value get, simple merge
  • mathutil int/number 相关操作的函数工具包. eg: convert, math calc, random
  • netutil Network util functions. eg: Ip, IpV4, IpV6, Mac, Port, Hostname, etc.
  • reflects 提供一些扩展性的反射使用工具函数.
  • structs 为 struct 提供一些扩展 util 函数。 eg: tag parse, struct data
  • strutil string 相关操作的函数工具包. eg: bytes, check, convert, encode, format and more
  • sysutil system 相关操作的函数工具包. eg: sysenv, exec, user, process

扩展工具包

  • cflag: 包装和扩展 go flag.FlagSet 以方便快速的构建简单的命令行应用程序
  • dump GO变量打印工具,打印 slice, map 会自动换行显示每个元素,同时会显示打印调用位置
  • encodes: Provide some encoding/decoding, hash, crypto util functions. eg: base64, hex, etc.
  • errorx 为 go 提供增强的错误实现,允许带有堆栈跟踪信息和包装另一个错误。
  • fsutil/finder 提供简单方便的file/dir查找功能,支持过滤、排除、匹配、忽略等。
  • netutil 子包:
    • netutil/httpreq 包装 http.Client 实现的更加易于使用的HTTP客户端, 和一些 http 工具函数
  • strutil 子包:
    • strutil/textscan 实现了一个快速扫描和分析文本内容的解析器. 可用于解析 INI, Properties 等格式内容
    • strutil/textutil 提供一些常用的扩展文本处理功能函数。
  • syncs 提供一些同步、协程、信号相关的工具函数.
  • sysutil 子包:
    • sysutil/clipboard 提供简单的剪贴板读写操作工具库
    • sysutil/cmdr 提供快速构建和运行一个cmd,批量运行多个cmd任务
    • sysutil/process 提供一些进程操作相关的实用功能。
  • testutil test help 相关操作的函数工具包. eg: http test, mock ENV value
    • testutil/assert 用于帮助测试的断言函数工具包,方便编写单元测试。
    • testutil/fakeobj 提供一些接口的假的实现,用于模拟测试. 例如 fs.File, fs.FileInfo, fs.DirEntry 等等.
  • timex 提供增强的 time.Time 实现。添加更多常用的功能方法
    • 提供类似 Y-m-d H:i:s 的日期时间格式解析处理
    • 常用时间方法。例如: DayStart(), DayAfter(), DayAgo(), DateFormat() 等等

版本更新记录

v0.6.8 更新日志

Fixed

Feature

Update

Other

v0.6.6 更新日志

Feature

Update

Other

v0.6.6 更新日志

Fixed

Feature

Update

Other

v0.6.5 更新日志

Feature

Update

v0.6.4 更新日志

Released at 2023.02.11

  • 🐛 fix(dump): makeslice: cap out of range. fix: #76 4ba9b10

v0.6.3 更新日志

Released at 2023.02.11

Update

  • ✨ up(env,sys): 新增 GetMulti, SetEnvMap, UnsetEnvs 等函数 9eaddb5
  • 👔 up(str): 调整 SplitInlineComment() 处理逻辑 31445cd
  • 👔 up(sys): 调整 SearchPath() 逻辑, 支持限制返回结果数 67cbae1
  • ✅ up(sys,env,map): add more tests case for util func 392536c
  • 👔 up(fs,sys): update some fs and sys util func run logic 7727628
  • 👔 up(struct): update some structs comments and update readme f461852
  • 👔 up(str): update some string util comments and func 796d1fe

Other

  • build(deps): bump golang.org/x/text from 0.6.0 to 0.7.0 1e3ea77

v0.6.2 更新日志

Released at 2023.02.02

Feature

  • 👔 feat: str - 新增检查方法 ContainsOne, ContainsAll, HasEmpty, IsAllEmpty 等 0e4792a
  • 👔 feat: str/textutil - 支持快速替换给定文本的变量 ecc23cb
  • 👔 feat: sys,proc - 添加和更新一些实用函数 aa78114
  • ✨ feat: fs - 添加一些实用函数 NewIOReader,TextScanner,LineScanner,ReadFile,ReadString 等 3352512
  • ✨ feat: map, struct - 新增实用函数 structs.ToString(), maputil.Data.Uint() 90af09e
  • ✨ feat: stdio - 新增实用函数 NewIOReader, NewScanner ea243d6
  • ✨ feat: arr - 新增检查函数 NotIn, In, ContainsAll/IsParent 2a18ca2
  • ✨ feat: textutil - 新增函数 IsMatchAll() 快速检查文本是否有关键字 d0dade8
  • ✨ feat: math - 新增泛型函数 Max, SwapMax 比较和交换值 176923b
  • feat: error, test - 新增工具函数 快速断言并返回错误或直接panic 7188216
  • ✨ feat: fs - 新增函数 MkDirs, MkSubDirs 批量创建目录或子目录 c4447cb
  • ✨ feat: env,sys - 新增函数 EnvPaths, SearchEnvKeys, SearchEnv 快速获取和搜索环境变量 b3d7669
  • ✨ feat: str - 新增函数 IEqual, IContains 忽略大小写检查字符串 746eb35
  • ✨ feat: goutil - 新增函数 CallOn, CallOrElse, OrError, OrValue, OrReturn 基于条件运行或返回值 97a2863
  • ✨ feat: arr - 新增函数 StringsAsInts, StringsTryInts, ConvType 等快速转换slice类型 75d8d89
  • ✨ feat: reflects - 新增函数 ConvSlice 通过反射方式转换 slice 类型 f87fc86
  • ✨ feat: structs - 初始化结构体 InitDefaults() 新增支持 slice 类型字段 948fa70
  • ✨ feat: byte - 新增函数 StrOrErr(), SafeString() 检查并在无错误时转为string 767ed80
  • ✨ feat: cmdr - cmdr.Cmd 新增方法 ToOSStdoutStderr, ToOSStdout 快速设置命令输出到 OS stdout, stderr 6aaea78

Update

  • 👔 up: str, math - 新增一些 OrElse() 等快速检测同时获取值的函数 cb21fbc
  • 👔 up: str - update some util func and add more tests a3e07f4
  • 👔 up: str,math - update some util func eaf0990
  • 👔 up: str,byte - add and update some util func cf5d34e
  • 👔 up: byte,cflag - update and add some new tests 6e47f69
  • 👔 up(env, str): 调整 ENV 变量解析逻辑 和新增 strutil.Valid() 5193849
  • 👔 up(str): update some str value get func 676fe4e

Fixed

  • 🐛 fix(env, str): fix the envutil test error and update some str util 2e7aa63
  • 🐛 fix: textscan - fix multi inline comments parse error bf68c94

Other

  • build(deps): bump golang.org/x/text from 0.5.0 to 0.6.0 79d7781
  • doc: re-generate the README docs 42e3084
  • doc: update the doc parse logic, support generic types 030676d
  • doc: generate and update README docs f342e92

v0.6.1 更新日志

发布于 2022.12.12

新特性

更新调整

其他