diff --git a/coverage.txt b/coverage.txt index ecc552ba..159093a7 100644 --- a/coverage.txt +++ b/coverage.txt @@ -2319,12 +2319,12 @@ github.com/christophe-duc/lazypodman/pkg/commands/runtime_socket.go:362.28,391.2 github.com/christophe-duc/lazypodman/pkg/commands/runtime_socket.go:391.24,394.4 2 0 github.com/christophe-duc/lazypodman/pkg/commands/runtime_socket.go:397.2,407.14 10 0 github.com/christophe-duc/lazypodman/pkg/commands/runtime_socket.go:411.40,416.2 4 0 -github.com/christophe-duc/lazypodman/pkg/commands/runtime_socket.go:419.55,421.21 2 0 +github.com/christophe-duc/lazypodman/pkg/commands/runtime_socket.go:419.50,421.21 2 0 github.com/christophe-duc/lazypodman/pkg/commands/runtime_socket.go:421.21,423.3 1 0 -github.com/christophe-duc/lazypodman/pkg/commands/runtime_socket.go:424.2,426.8 3 0 -github.com/christophe-duc/lazypodman/pkg/commands/runtime_socket.go:430.52,432.21 2 0 +github.com/christophe-duc/lazypodman/pkg/commands/runtime_socket.go:424.2,426.21 3 0 +github.com/christophe-duc/lazypodman/pkg/commands/runtime_socket.go:430.46,432.21 2 0 github.com/christophe-duc/lazypodman/pkg/commands/runtime_socket.go:432.21,434.3 1 0 -github.com/christophe-duc/lazypodman/pkg/commands/runtime_socket.go:435.2,437.8 3 0 +github.com/christophe-duc/lazypodman/pkg/commands/runtime_socket.go:435.2,437.22 3 0 github.com/christophe-duc/lazypodman/pkg/commands/runtime_socket.go:441.38,443.26 2 0 github.com/christophe-duc/lazypodman/pkg/commands/runtime_socket.go:443.26,445.3 1 0 github.com/christophe-duc/lazypodman/pkg/commands/runtime_socket.go:448.2,453.12 5 0 diff --git a/pkg/commands/runtime_libpod.go b/pkg/commands/runtime_libpod.go index 9b146cb2..25c9c1d8 100644 --- a/pkg/commands/runtime_libpod.go +++ b/pkg/commands/runtime_libpod.go @@ -375,7 +375,7 @@ func (r *LibpodRuntime) PodStats(ctx context.Context, id string, stream bool) (< } // aggregatePodContainerStats collects and aggregates stats from all containers in a pod. -func (r *LibpodRuntime) aggregatePodContainerStats(ctx context.Context, pod *libpod.Pod) (PodStatsEntry, error) { +func (r *LibpodRuntime) aggregatePodContainerStats(_ context.Context, pod *libpod.Pod) (PodStatsEntry, error) { ctrs, err := pod.AllContainers() if err != nil { return PodStatsEntry{}, err diff --git a/pkg/commands/runtime_socket.go b/pkg/commands/runtime_socket.go index 32f654d7..d0c87693 100644 --- a/pkg/commands/runtime_socket.go +++ b/pkg/commands/runtime_socket.go @@ -411,30 +411,30 @@ func aggregatePodStats(reports []*types.PodStatsReport) PodStatsEntry { func parsePercentage(s string) float64 { s = strings.TrimSuffix(strings.TrimSpace(s), "%") var val float64 - fmt.Sscanf(s, "%f", &val) + _, _ = fmt.Sscanf(s, "%f", &val) return val } // parseMemoryBytes parses memory usage string like "1000000 / 4000000" into usage and limit. -func parseMemoryBytes(s string) (usage, limit uint64) { +func parseMemoryBytes(s string) (uint64, uint64) { parts := strings.Split(s, "/") if len(parts) != 2 { return 0, 0 } - usage = parseByteValue(strings.TrimSpace(parts[0])) - limit = parseByteValue(strings.TrimSpace(parts[1])) - return + usage := parseByteValue(strings.TrimSpace(parts[0])) + limit := parseByteValue(strings.TrimSpace(parts[1])) + return usage, limit } // parseIOBytes parses I/O string like "1.5kB / 2.3kB" into input and output bytes. -func parseIOBytes(s string) (input, output uint64) { +func parseIOBytes(s string) (uint64, uint64) { parts := strings.Split(s, "/") if len(parts) != 2 { return 0, 0 } - input = parseByteValue(strings.TrimSpace(parts[0])) - output = parseByteValue(strings.TrimSpace(parts[1])) - return + input := parseByteValue(strings.TrimSpace(parts[0])) + output := parseByteValue(strings.TrimSpace(parts[1])) + return input, output } // parseByteValue parses a byte value string with optional unit (e.g., "1.5kB", "10MB", "1000000"). @@ -475,7 +475,7 @@ func parseByteValue(s string) uint64 { func parseUint(s string) uint64 { s = strings.TrimSpace(s) var val uint64 - fmt.Sscanf(s, "%d", &val) + _, _ = fmt.Sscanf(s, "%d", &val) return val }