go-carbon v2.6.10发布,轻量级、语义化、对开发者友好的 golang 时间处理库
carbon 是一个轻量级、语义化、对开发者友好的 Golang 时间处理库,提供了对时间穿越、时间差值、时间极值、时间判断、星座、星座、农历、儒略日 / 简化儒略日、波斯历 / 伊朗历的支持。
carbon 目前已捐赠给 dromara 开源组织,已被 awesome-go 收录,并获得 gitee 2024 年最有价值项目(GVP)和 gitcode 2024 年度 G-Star 项目,如果您觉得不错,请给个 star 吧
官网: carbon.go-pkg.com
github: github.com/dromara/carbon
gitee: gitee.com/dromara/carbon
gitcode: gitcode.com/dromara/carbon
中文
- 将
日语
翻译文件从jp.json
改成ja.json
,说明文档从README.jp.md
更名为README.ja.md
,以符合 ISO639-1 标准 - 移除已弃用的
ParseWithLayouts
方法,用ParseByLayouts
方法替代 - 移除已弃用的
ParseWithFormats
方法,用ParseByFormats
方法替代 - 移除已弃用的
CleanTestNow
方法,用ClearTestNow
方法替代 - 移除
ParseByLayout
和ParseByFormat
方法对时间戳
字符串的解析支持,解析时间戳
请使用CreateFromTimestamp
,CreateFromTimestampMilli
,CreateFromTimestampMicro
,CreateFromTimestampNano
方法 - 优化
helper.go
里getAbsValue
方法,用位操作
替换条件判断 - 优化
frozen.go
文件里时间冻结相关方法,用原子操作
减少锁竞争,优化内存分配 - 优化基准测试文件,覆盖
串行测试
、并行测试
和并发测试
- 新增韩语文档
README.ko.md
- 新增
Sleep
方法及相关单元测试
、基准测试
和示例文件
- 新增数字常量,如
MaxYear
,MinYear
,MaxMonth
,MinMonth
,MaxDay
,MinDay
等,并使用这些常量替换硬编码
English
- Change
Japanese
translation file fromjp.json
toja.json
and rename document fromREADME.jp.md
toREADME.ja.md
to comply with the ISO639-1 standard - Remove deprecated
ParseWithLayouts
method and replace withParseByLayouts
method - Remove deprecated
ParseWithFormats
method and replace withParseByFormats
method - Remove deprecated
CleanTestNow
method and replace withClearTestNow
method - Remove parsing support for timestamp strings from
ParseByLayout
andParseByFormat
methods, useCreateFromTimestamp
,CreateFromTimestampMilli
,CreateFromTimestampMicro
,CreateFromTimestampNano
to parse timestamp strings - Optimize
getAbsValue
method inhelper.go
to replace conditional judgments withbitwise operation
- Optimize the methods related to time freezing in
frozen.go
, reduce lock contention usingatomic operation
and optimize memory allocation - Optimize benchmark test files to cover
serial
testing,parallel
testing andconcurrent
testing - Add Korean readme document
README.ko.md
- Add
Sleep
method and relatedunit tests
,benchmark tests
, andexample file
- Add number constants such as
MaxYear
,MinYear
,MaxMonth
,MinMonth
,MaxDay
,MinDay
etc. and replace hard coded with these constants
本作品采用《CC 协议》,转载必须注明作者和本文链接
推荐文章: