Skip to content

Commit e55fc56

Browse files
committed
Fix golint issues in pkg/util/sysctl/testing
1 parent 8b123b1 commit e55fc56

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed

hack/.golint_failures

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,6 @@ pkg/util/procfs
234234
pkg/util/removeall
235235
pkg/util/rlimit
236236
pkg/util/selinux
237-
pkg/util/sysctl/testing
238237
pkg/util/taints
239238
pkg/volume
240239
pkg/volume/azure_dd

pkg/util/sysctl/testing/fake.go

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -22,30 +22,31 @@ import (
2222
"k8s.io/kubernetes/pkg/util/sysctl"
2323
)
2424

25-
// fake is a map-backed implementation of sysctl.Interface, for testing/mocking
26-
type fake struct {
25+
// Fake is a map-backed implementation of sysctl.Interface, for testing/mocking.
26+
type Fake struct {
2727
Settings map[string]int
2828
}
2929

30-
func NewFake() *fake {
31-
return &fake{
30+
// NewFake creates a fake sysctl implementation.
31+
func NewFake() *Fake {
32+
return &Fake{
3233
Settings: make(map[string]int),
3334
}
3435
}
3536

36-
// GetSysctl returns the value for the specified sysctl setting
37-
func (m *fake) GetSysctl(sysctl string) (int, error) {
37+
// GetSysctl returns the value for the specified sysctl setting.
38+
func (m *Fake) GetSysctl(sysctl string) (int, error) {
3839
v, found := m.Settings[sysctl]
3940
if !found {
4041
return -1, os.ErrNotExist
4142
}
4243
return v, nil
4344
}
4445

45-
// SetSysctl modifies the specified sysctl flag to the new value
46-
func (m *fake) SetSysctl(sysctl string, newVal int) error {
46+
// SetSysctl modifies the specified sysctl flag to the new value.
47+
func (m *Fake) SetSysctl(sysctl string, newVal int) error {
4748
m.Settings[sysctl] = newVal
4849
return nil
4950
}
5051

51-
var _ = sysctl.Interface(&fake{})
52+
var _ = sysctl.Interface(&Fake{})

0 commit comments

Comments
 (0)