Skip to content

Commit b66a3ea

Browse files
committed
devices: rm nolint annotations
Both revive and staticcheck complains like this: > devices/devices_emulator.go:239:20: ST1016: methods on the same type should have the same receiver name (seen 1x "source", 8x "e") (staticcheck) > func (e *emulator) Apply(rule devices.Rule) error { > ^ What they mean to point to is this line: > func (source *emulator) Transition(target *emulator) ([]*devices.Rule, error) { In here, "source" does actually make sense, but instead of suppressing these warnings, let's just give up and rename the receiver, and introduce a source variable instead. Signed-off-by: Kir Kolyshkin <[email protected]>
1 parent f02578c commit b66a3ea

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

devices/devices_emulator.go

+2-1
Original file line numberDiff line numberDiff line change
@@ -304,8 +304,9 @@ func emulatorFromList(list io.Reader) (*emulator, error) {
304304
// This function is the sole reason for all of emulator -- to allow us
305305
// to figure out how to update a containers' cgroups without causing spurious
306306
// device errors (if possible).
307-
func (source *emulator) Transition(target *emulator) ([]*devices.Rule, error) { //nolint:revive // Ignore receiver-naming warning.
307+
func (e *emulator) Transition(target *emulator) ([]*devices.Rule, error) {
308308
var transitionRules []*devices.Rule
309+
source := e
309310
oldRules := source.rules
310311

311312
// If the default policy doesn't match, we need to include a "disruptive"

0 commit comments

Comments
 (0)