From 1ceca3718bd8a85005790a6593019408d2324788 Mon Sep 17 00:00:00 2001 From: Kir Kolyshkin Date: Mon, 24 Mar 2025 11:32:47 -0700 Subject: [PATCH] Fix staticcheck ST1020/ST1021 warnings I was pretty sure we have a linter for these but apparently we did not. > libcontainer/capabilities/capabilities.go:108:1: ST1020: comment on exported method ApplyCaps should be of the form "ApplyCaps ..." (staticcheck) > // Apply sets all the capabilities for the current process in the config. > ^ > > > types/events.go:15:1: ST1021: comment on exported type Stats should be of the form "Stats ..." (with optional leading article) (staticcheck) > // stats is the runc specific stats structure for stability when encoding and decoding stats. > ^ Signed-off-by: Kir Kolyshkin (cherry picked from commit 30f8acabf6050be2c5e840259cbb5509de0849d9) Signed-off-by: lifubang --- libcontainer/capabilities/capabilities.go | 2 +- types/events.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/libcontainer/capabilities/capabilities.go b/libcontainer/capabilities/capabilities.go index 8bddc0007..379e66c66 100644 --- a/libcontainer/capabilities/capabilities.go +++ b/libcontainer/capabilities/capabilities.go @@ -114,7 +114,7 @@ func (c *Caps) ApplyBoundingSet() error { return c.pid.Apply(capability.BOUNDING) } -// Apply sets all the capabilities for the current process in the config. +// ApplyCaps sets all the capabilities for the current process in the config. func (c *Caps) ApplyCaps() error { if c.pid == nil { return nil diff --git a/types/events.go b/types/events.go index 8af94236b..ed7d2408f 100644 --- a/types/events.go +++ b/types/events.go @@ -12,7 +12,7 @@ type Event struct { Data interface{} `json:"data,omitempty"` } -// stats is the runc specific stats structure for stability when encoding and decoding stats. +// Stats is the runc specific stats structure for stability when encoding and decoding stats. type Stats struct { CPU Cpu `json:"cpu"` CPUSet CPUSet `json:"cpuset"`