From 3532df46a29171d948b1a97fa67687618724e643 Mon Sep 17 00:00:00 2001 From: chaosi-zju Date: Tue, 2 Jan 2024 20:42:35 +0800 Subject: [PATCH] cleanup: enable revive(receiver-naming) checking Signed-off-by: chaosi-zju --- .golangci.yml | 1 + test/e2e/framework/karmadactl.go | 8 ++++---- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/.golangci.yml b/.golangci.yml index 01b095a40..15fce3f2c 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -71,6 +71,7 @@ linters-settings: - preserveScope - name: error-strings - name: error-return + - name: receiver-naming staticcheck: checks: - all diff --git a/test/e2e/framework/karmadactl.go b/test/e2e/framework/karmadactl.go index 5704c4e69..61ed73b8f 100644 --- a/test/e2e/framework/karmadactl.go +++ b/test/e2e/framework/karmadactl.go @@ -110,9 +110,9 @@ func (k *KarmadactlBuilder) exec() (string, error) { } // execWithFullOutput runs the karmadactl executable, and returns the stdout and stderr. -func (b KarmadactlBuilder) execWithFullOutput() (string, string, error) { +func (k KarmadactlBuilder) execWithFullOutput() (string, string, error) { var stdout, stderr bytes.Buffer - cmd := b.cmd + cmd := k.cmd cmd.Stdout, cmd.Stderr = &stdout, &stderr if err := cmd.Start(); err != nil { @@ -134,8 +134,8 @@ func (b KarmadactlBuilder) execWithFullOutput() (string, string, error) { Code: rc, } } - case <-b.timeout: - err := b.cmd.Process.Kill() + case <-k.timeout: + err := k.cmd.Process.Kill() if err != nil { return "", "", fmt.Errorf("after execution timeout, error killing %v:\nCommand stdout:\n%v\nstderr:\n%v\nerror:\n%v", cmd, cmd.Stdout, cmd.Stderr, err) }