refactor: Optimize code by using built-in constants in the standard library (#9963)

Signed-off-by: sellskin <mydesk@yeah.net>
This commit is contained in:
sellskin 2024-04-10 00:54:15 +08:00 committed by GitHub
parent 82b11f53b2
commit 3a1b2633bb

@ -269,8 +269,7 @@ func TestSlidingWindow_CustomBucket(t *testing.T) {
// ts is a convenient method that must parse a time.Time from a string in format `"2006-01-02 15:04:05"` // ts is a convenient method that must parse a time.Time from a string in format `"2006-01-02 15:04:05"`
func ts(s string) time.Time { func ts(s string) time.Time {
format := "2006-01-02 15:04:05" t, err := time.Parse(time.DateTime, s)
t, err := time.Parse(format, s)
if err != nil { if err != nil {
panic(err) panic(err)
} }