lint: gopls fixes

Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
This commit is contained in:
CrazyMax
2025-09-09 14:00:36 +02:00
parent 060be8484d
commit d31230ea96
22 changed files with 50 additions and 50 deletions

View File

@@ -35,8 +35,8 @@ func getCgroupIOStat(cgroupPath string) (*resourcestypes.IOStat, error) {
}
ioStat := &resourcestypes.IOStat{}
lines := strings.Split(string(data), "\n")
for _, line := range lines {
lines := strings.SplitSeq(string(data), "\n")
for line := range lines {
parts := strings.Fields(line)
if len(parts) < 2 {
continue

View File

@@ -138,8 +138,8 @@ func parseKeyValueFile(filePath string, callback func(key string, value uint64))
return errors.Wrapf(err, "failed to read %s", filePath)
}
lines := strings.Split(string(content), "\n")
for _, line := range lines {
lines := strings.SplitSeq(string(content), "\n")
for line := range lines {
if len(strings.TrimSpace(line)) == 0 {
continue
}

View File

@@ -273,7 +273,7 @@ func prepareCgroupControllers() error {
if err != nil {
return err
}
for _, c := range strings.Split(string(dt), " ") {
for c := range strings.SplitSeq(string(dt), " ") {
if c == "" {
continue
}