pkg/sysinfo.newV2() remove redundant path.Clean()

path.Join() already does path.Clean(), and the opts.cg2GroupPath
field is already cleaned as part of WithCgroup2GroupPath()

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
Sebastiaan van Stijn
2021-07-14 14:45:01 +02:00
parent 6677ab6a63
commit e70c5ea1a9

View File

@@ -47,7 +47,7 @@ func newV2(quiet bool, options ...Opt) *SysInfo {
applyPIDSCgroupInfoV2,
applyDevicesCgroupInfoV2,
}
dirPath := path.Join("/sys/fs/cgroup", path.Clean(g))
dirPath := path.Join("/sys/fs/cgroup", g)
for _, o := range opsV2 {
w := o(sysInfo, controllersM, dirPath)
warnings = append(warnings, w...)