From facb901d4cce8df347440b158285645706b39c38 Mon Sep 17 00:00:00 2001 From: black-desk Date: Tue, 24 Oct 2023 13:59:13 +0800 Subject: [PATCH] style: reduce indent Signed-off-by: black-desk --- pkg/cgfsmon/private.go | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/pkg/cgfsmon/private.go b/pkg/cgfsmon/private.go index a542031..e05a82e 100644 --- a/pkg/cgfsmon/private.go +++ b/pkg/cgfsmon/private.go @@ -12,14 +12,15 @@ import ( func (m *CGroupFSMonitor) walkFn(events *[]types.CGroupEvent) func(path string, d fs.DirEntry, err error) error { return func(path string, d fs.DirEntry, err error) error { + if errors.Is(err, fs.ErrNotExist) { + m.log.Debug( + "Cgroup had been removed.", + "path", path, + ) + err = nil + } + if err != nil { - if errors.Is(err, fs.ErrNotExist) { - m.log.Debug( - "Cgroup had been removed.", - "path", path, - ) - err = nil - } m.log.Errorw( "Errors occurred while first time going through cgroupfs.", "path", path,