Skip to content

Commit e2e5bf5

Browse files
author
Guangwen Feng
committed
Fix golint warning for pkg/util/procfs/procfs_linux.go
Signed-off-by: Guangwen Feng <[email protected]>
1 parent 2da2c3b commit e2e5bf5

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

pkg/util/procfs/procfs_linux.go

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,10 @@ import (
3636
"k8s.io/klog"
3737
)
3838

39+
// ProcFS provides a helper for getting container name via pid.
3940
type ProcFS struct{}
4041

42+
// NewProcFS returns a ProcFS object.
4143
func NewProcFS() ProcFSInterface {
4244
return &ProcFS{}
4345
}
@@ -53,7 +55,7 @@ func containerNameFromProcCgroup(content string) (string, error) {
5355
return "", fmt.Errorf("could not find devices cgroup location")
5456
}
5557

56-
// getFullContainerName gets the container name given the root process id of the container.
58+
// GetFullContainerName gets the container name given the root process id of the container.
5759
// E.g. if the devices cgroup for the container is stored in /sys/fs/cgroup/devices/docker/nginx,
5860
// return docker/nginx. Assumes that the process is part of exactly one cgroup hierarchy.
5961
func (pfs *ProcFS) GetFullContainerName(pid int) (string, error) {
@@ -68,8 +70,8 @@ func (pfs *ProcFS) GetFullContainerName(pid int) (string, error) {
6870
return containerNameFromProcCgroup(string(content))
6971
}
7072

71-
// Find process(es) using a regular expression and send a specified
72-
// signal to each process
73+
// PKill finds process(es) using a regular expression and send a specified
74+
// signal to each process.
7375
func PKill(name string, sig syscall.Signal) error {
7476
if len(name) == 0 {
7577
return fmt.Errorf("name should not be empty")
@@ -91,8 +93,8 @@ func PKill(name string, sig syscall.Signal) error {
9193
return utilerrors.NewAggregate(errList)
9294
}
9395

94-
// Find process(es) with a specified name (regexp match)
95-
// and return their pid(s)
96+
// PidOf finds process(es) with a specified name (regexp match)
97+
// and return their pid(s).
9698
func PidOf(name string) ([]int, error) {
9799
if len(name) == 0 {
98100
return []int{}, fmt.Errorf("name should not be empty")

0 commit comments

Comments
 (0)