@@ -25,25 +25,25 @@ var (
25
25
errUnified = errors .New ("not implemented for cgroup v2 unified hierarchy" )
26
26
)
27
27
28
- type NotFoundError struct {
29
- Subsystem string
28
+ type notFoundError struct {
29
+ subsystem string
30
30
}
31
31
32
- func (e * NotFoundError ) Error () string {
33
- return fmt .Sprintf ("mountpoint for %s not found" , e .Subsystem )
32
+ func (e * notFoundError ) Error () string {
33
+ return fmt .Sprintf ("mountpoint for %s not found" , e .subsystem )
34
34
}
35
35
36
- func NewNotFoundError (sub string ) error {
37
- return & NotFoundError {
38
- Subsystem : sub ,
36
+ func newNotFoundError (sub string ) error {
37
+ return & notFoundError {
38
+ subsystem : sub ,
39
39
}
40
40
}
41
41
42
42
func IsNotFound (err error ) bool {
43
43
if err == nil {
44
44
return false
45
45
}
46
- _ , ok := err .(* NotFoundError )
46
+ _ , ok := err .(* notFoundError )
47
47
return ok
48
48
}
49
49
@@ -65,7 +65,7 @@ func FindCgroupMountpointAndRoot(cgroupPath, subsystem string) (string, string,
65
65
// parsing it directly sped up x10 times because of not using Sscanf.
66
66
// It was one of two major performance drawbacks in container start.
67
67
if ! isSubsystemAvailable (subsystem ) {
68
- return "" , "" , NewNotFoundError (subsystem )
68
+ return "" , "" , newNotFoundError (subsystem )
69
69
}
70
70
71
71
f , err := os .Open ("/proc/self/mountinfo" )
@@ -97,7 +97,7 @@ func findCgroupMountpointAndRootFromReader(reader io.Reader, cgroupPath, subsyst
97
97
return "" , "" , err
98
98
}
99
99
100
- return "" , "" , NewNotFoundError (subsystem )
100
+ return "" , "" , newNotFoundError (subsystem )
101
101
}
102
102
103
103
func isSubsystemAvailable (subsystem string ) bool {
@@ -340,5 +340,5 @@ func getControllerPath(subsystem string, cgroups map[string]string) (string, err
340
340
return p , nil
341
341
}
342
342
343
- return "" , NewNotFoundError (subsystem )
343
+ return "" , newNotFoundError (subsystem )
344
344
}
0 commit comments