mirror of
https://github.com/moby/buildkit.git
synced 2026-06-30 19:57:39 +00:00
lint: gopls fixes
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user