-
Notifications
You must be signed in to change notification settings - Fork 32
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
Use time.Time
in more places
#976
Conversation
clients/shared/default_value_test.go
Outdated
@@ -25,7 +25,7 @@ var dialects = []sql.Dialect{ | |||
|
|||
func TestColumn_DefaultValue(t *testing.T) { | |||
birthday := time.Date(2022, time.September, 6, 3, 19, 24, 942000000, time.UTC) | |||
birthdayExtDateTime, err := ext.ParseExtendedDateTime(birthday.Format(ext.ISO8601), ext.TimestampTZKindType) | |||
birthdayExtDateTime, err := ext.ParseDateTime(birthday.Format(ext.ISO8601), ext.TimestampTZKindType) |
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.
Nit: want to rename birthdayExtDateTime
to birthdayDateTime
?
lib/typing/ext/parse_test.go
Outdated
@@ -18,7 +18,7 @@ func TestParseFromInterface(t *testing.T) { | |||
for _, val := range vals { | |||
extTime, err := ParseFromInterface(val, TimestampTZKindType) |
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.
Rename this var too?
lib/typing/ext/parse_test.go
Outdated
@@ -18,7 +18,7 @@ func TestParseFromInterface(t *testing.T) { | |||
for _, val := range vals { | |||
extTime, err := ParseFromInterface(val, TimestampTZKindType) | |||
assert.NoError(t, err) | |||
assert.Equal(t, val, extTime) | |||
assert.Equal(t, val.(*ExtendedTime).GetTime(), extTime) |
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.
On line 13, can we declare vals
as []ExtendedTime
instead of []any
so we don't have to cast val
here?
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.
Oh or will that make ParseFromInterface
not accept it?
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.
It can accept ExtendedTime
!
lib/typing/ext/parse_test.go
Outdated
assert.NoError(t, err) | ||
assert.Equal(t, TimeKindType, et.GetNestedKind().Type) | ||
// Without passing an override format, this should return the same preserved dt format. |
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.
Is this comment no longer relevant?
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.
Yup, we don't need it anymore!
lib/typing/ext/parse_test.go
Outdated
assert.NoError(t, err) | ||
assert.Equal(t, DateKindType, et.GetNestedKind().Type) | ||
|
||
// Without passing an override format, this should return the same preserved dt format. |
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.
Same with this one
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.
A few nitpicks, otherwise lg!
As the title states. The goal is to eventually get rid of
ExtendedTime
altogether.