cleanup: enable revive(receiver-naming) checking
Signed-off-by: chaosi-zju <chaosi@zju.edu.cn>
This commit is contained in:
parent
845ee83819
commit
3532df46a2
|
@ -71,6 +71,7 @@ linters-settings:
|
||||||
- preserveScope
|
- preserveScope
|
||||||
- name: error-strings
|
- name: error-strings
|
||||||
- name: error-return
|
- name: error-return
|
||||||
|
- name: receiver-naming
|
||||||
staticcheck:
|
staticcheck:
|
||||||
checks:
|
checks:
|
||||||
- all
|
- all
|
||||||
|
|
|
@ -110,9 +110,9 @@ func (k *KarmadactlBuilder) exec() (string, error) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// execWithFullOutput runs the karmadactl executable, and returns the stdout and stderr.
|
// 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
|
var stdout, stderr bytes.Buffer
|
||||||
cmd := b.cmd
|
cmd := k.cmd
|
||||||
cmd.Stdout, cmd.Stderr = &stdout, &stderr
|
cmd.Stdout, cmd.Stderr = &stdout, &stderr
|
||||||
|
|
||||||
if err := cmd.Start(); err != nil {
|
if err := cmd.Start(); err != nil {
|
||||||
|
@ -134,8 +134,8 @@ func (b KarmadactlBuilder) execWithFullOutput() (string, string, error) {
|
||||||
Code: rc,
|
Code: rc,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
case <-b.timeout:
|
case <-k.timeout:
|
||||||
err := b.cmd.Process.Kill()
|
err := k.cmd.Process.Kill()
|
||||||
if err != nil {
|
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)
|
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)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue