Skip to content
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

紧急问题, 升级V1.5.0之后, ToDateTimeString 出错 #86

Closed
liaohongxing opened this issue Aug 10, 2021 · 4 comments
Closed

紧急问题, 升级V1.5.0之后, ToDateTimeString 出错 #86

liaohongxing opened this issue Aug 10, 2021 · 4 comments
Labels
Bug Report a reproducible bug or regression Fixed Bug fixed

Comments

@liaohongxing
Copy link

liaohongxing commented Aug 10, 2021

把 carbon.ToDateTimeString 用作时间字段,全站全崩

type Class struct {
	ID          int                         `gorm:"primarykey" json:"id" form:"id"`
	Name        string                      `gorm:"size:80" json:"name" form:"name"`
	CreatedAt   carbon.ToDateTimeString     `json:"created_at" form:"created_at"`
	UpdatedAt   carbon.ToDateTimeString     `json:"updated_at" form:"updated_at"`
	Status      int8                        `gorm:"index" json:"status" form:"status"`
}

v1.5.0 直接报错。之前的版本没有问题,报错信息:

time: missing Location in call to Time.In

疑似跟最近一次更新有关:

golang-module/carbon@63ac859#diff-3a959176e85691e2f895b56153bc13c863f1e95acc0476a53affd12ad7fb1be7

@liaohongxing liaohongxing added the Question Indicates that an issue, pull request, or discussion needs more information label Aug 10, 2021
@liaohongxing
Copy link
Author

liaohongxing commented Aug 10, 2021

似乎 Scan 的时候 c.loc 是空的 , ORM是 GORM @gouguoyin

@gouguoyin
Copy link
Collaborator

This problem does exist, version 1.5.1 will be released today and this bug will be fixed together.

@gouguoyin
Copy link
Collaborator

V1.5.1 has been released, please upgrade and try again

@gouguoyin gouguoyin added Bug Report a reproducible bug or regression Fixed Bug fixed and removed Question Indicates that an issue, pull request, or discussion needs more information labels Aug 10, 2021
@gouguoyin
Copy link
Collaborator

Have you solved it?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Report a reproducible bug or regression Fixed Bug fixed
Projects
None yet
Development

No branches or pull requests

2 participants