From 02022208813d0f4a87432ffc8ef03903ab6763b5 Mon Sep 17 00:00:00 2001 From: coderwander <166724773+coderwander@users.noreply.github.com> Date: Tue, 16 Apr 2024 15:43:16 +0800 Subject: [PATCH] refactor: Optimize code by using built-in constants in the standard library (#2989) Signed-off-by: coderwander <770732124@qq.com> --- collector/os_release.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/collector/os_release.go b/collector/os_release.go index 5d2e9429..9d0a7a1b 100644 --- a/collector/os_release.go +++ b/collector/os_release.go @@ -180,7 +180,7 @@ func (c *osReleaseCollector) UpdateStruct(path string) error { } 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 { return err