Skip to content

Commit 0202220

Browse files
authored
refactor: Optimize code by using built-in constants in the standard library (#2989)
Signed-off-by: coderwander <[email protected]>
1 parent bf67c85 commit 0202220

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

collector/os_release.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ func (c *osReleaseCollector) UpdateStruct(path string) error {
180180
}
181181

182182
if c.os.SupportEnd != "" {
183-
c.supportEnd, err = time.Parse("2006-01-02", c.os.SupportEnd)
183+
c.supportEnd, err = time.Parse(time.DateOnly, c.os.SupportEnd)
184184

185185
if err != nil {
186186
return err

0 commit comments

Comments
 (0)