feat: upgrade carbon to v2.5.6#989
feat: upgrade carbon to v2.5.6#989hwbrzzl merged 19 commits intogoravel:v1.15.xfrom go-libraries:carbon
Conversation
… default global timezone has been changed to `UTC` - 移除了 Clock 结构体和 clock全局变量 - 使用 carbon包的静态方法替代了大部分功能 - 简化了 timezone 的处理逻辑 - 删除了冗余的 getTimezone 函数
|
Thanks, but CI failed. |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## v1.15.x #989 +/- ##
==========================================
Coverage ? 70.07%
==========================================
Files ? 234
Lines ? 19672
Branches ? 0
==========================================
Hits ? 13785
Misses ? 5225
Partials ? 662 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
v2.5.5
hwbrzzl
left a comment
There was a problem hiding this comment.
Amazing PR 👍 Just two nitpicks. And could you upgrade carbon to 2.6 for the master branch when you have a chance?
support/carbon/errors.go
Outdated
|
|
||
| // returns a failed scan error. | ||
| // 失败的扫描错误 | ||
| var failedScanError = func(src interface{}) error { |
There was a problem hiding this comment.
| var failedScanError = func(src interface{}) error { | |
| var failedScanError = func(src any) error { |
support/carbon/errors.go
Outdated
| // returns a invalid timestamp error. | ||
| // 无效的时间戳错误 | ||
| var invalidTimestampError = func(value string) error { | ||
| return fmt.Errorf("invalid timestamp %s, please make sure the timestamp is valid", value) |
There was a problem hiding this comment.
The errors in this file can be moved to errors/list.go and use constants here.
two nitpicks already completed, review again. Upgrading to version |
support/carbon/type_date.go
Outdated
| c = FromTimestamp(v, DefaultTimezone) | ||
| default: | ||
| return failedScanError(v) | ||
| return errors.CarbonFailedScan |
There was a problem hiding this comment.
v can be passed to the error: errors.CarbonFailedScan.Args(v), and change: CarbonFailedScan = New("failed to scan %s as carbon")
errors/list.go
Outdated
| ValidationEmptyData = New("data can't be empty") | ||
| ValidationEmptyRules = New("rules can't be empty") | ||
|
|
||
| CarbonFailedScan = New("failed to scan %s as carbon") |
There was a problem hiding this comment.
| CarbonFailedScan = New("failed to scan %s as carbon") | |
| CarbonFailedScan = New("failed to scan %v as carbon") |



📑 Description
Closes https://github.com/goravel/goravel/issues/
✅ Checks