Skip to content
This repository has been archived by the owner on Jun 28, 2020. It is now read-only.

issue9/utils

Repository files navigation

utils Build Status Build Status license codecov

此模块不再更新,部分功能分拆至 sliceutil、localeutil 和 source 三个模块中

utils 包提供了一些常用的 Go 函数

  • MD5 生成 md5 编码;
  • FileExists 判断文件或是目录是否存在;
  • Merge 合并多个同类型的数据;

localeutil:

  • GetSystemLanguageTag 获取当前系统的本地化信息;

source:

  • DumpGoSource 输出并格式化 Go 的源代码;
  • CurrentFile 相当于部分语言的 __FILE__
  • CurrentDir 相当于部分语言的 __DIR__
  • CurrentLine 相当于部分语言的 __LINE__
  • CurrentFunction 相当于部分语言的 __FUNCTION__

slliceutil:

  • HasDuplication 检测数组是否包含重复的值;

安装

go get github.com/issue9/utils

文档

Go Walker go.dev reference

版权

本项目采用 MIT 开源授权许可证,完整的授权说明可在 LICENSE 文件中找到。