Skip to content

Commit fb0956c

Browse files
authored
Merge pull request kubernetes#85016 from hvaara/fix-golint-pkg-util-sysctl-testing
Fix golint issues in pkg/util/sysctl/testing
2 parents 40750a0 + e55fc56 commit fb0956c

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
@@ -208,7 +208,6 @@ pkg/util/procfs
208208
pkg/util/removeall
209209
pkg/util/rlimit
210210
pkg/util/selinux
211-
pkg/util/sysctl/testing
212211
pkg/util/taints
213212
pkg/volume
214213
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)