-
Notifications
You must be signed in to change notification settings - Fork 91
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: upgrade carbon to v2.5.6 #989
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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
@@ -33,7 +35,7 @@ func (t *Date) Scan(src interface{}) error { | |||
case int64: | |||
c = FromTimestamp(v, DefaultTimezone) | |||
default: | |||
return failedScanError(v) | |||
return errors.CarbonFailedScan |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
v
can be passed to the error: errors.CarbonFailedScan.Args(v)
, and change: CarbonFailedScan = New("failed to scan %s as carbon")
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
errors/list.go
Outdated
@@ -138,4 +138,7 @@ var ( | |||
ValidationDuplicateRule = New("duplicate rule name: %s") | |||
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
CarbonFailedScan = New("failed to scan %s as carbon") | |
CarbonFailedScan = New("failed to scan %v as carbon") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
📑 Description
Closes https://github.com/goravel/goravel/issues/
✅ Checks