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

Signed-off-by: coderwander <770732124@qq.com>
This commit is contained in:
coderwander 2024-04-16 15:43:16 +08:00 committed by GitHub
parent bf67c859bb
commit 0202220881
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -180,7 +180,7 @@ func (c *osReleaseCollector) UpdateStruct(path string) error {
} }
if c.os.SupportEnd != "" { if c.os.SupportEnd != "" {
c.supportEnd, err = time.Parse("2006-01-02", c.os.SupportEnd) c.supportEnd, err = time.Parse(time.DateOnly, c.os.SupportEnd)
if err != nil { if err != nil {
return err return err