From e4c214d02eba7f534ab2f328ac6bf8203b52ff3e Mon Sep 17 00:00:00 2001 From: coderwander <770732124@qq.com> Date: Tue, 16 Apr 2024 11:35:57 +0800 Subject: [PATCH] refactor: Optimize code by using built-in constants in the standard library 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 5d2e94296c..9d0a7a1b31 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