libct/int: fix "simple" linter warnings

This fixes the following warnings:

> libcontainer/integration/exec_test.go:369:18: S1030: should use stdout.String() instead of string(stdout.Bytes()) (gosimple)
>	outputStatus := string(stdout.Bytes())
>	                ^
> libcontainer/integration/exec_test.go:422:18: S1030: should use stdout.String() instead of string(stdout.Bytes()) (gosimple)
>	outputStatus := string(stdout.Bytes())
>	                ^
> libcontainer/integration/exec_test.go:486:18: S1030: should use stdout.String() instead of string(stdout.Bytes()) (gosimple)
>	outputGroups := string(stdout.Bytes())
>	                ^
> libcontainer/integration/execin_test.go:191:18: S1030: should use stdout.String() instead of string(stdout.Bytes()) (gosimple)
>	outputGroups := string(stdout.Bytes())
>	                ^
> libcontainer/integration/execin_test.go:474:9: S1030: should use stdout.String() instead of string(stdout.Bytes()) (gosimple)
>	out := string(stdout.Bytes())
>	       ^

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
This commit is contained in:
Kir Kolyshkin
2020-11-30 10:39:59 -08:00
parent 11680cd2c7
commit 3387422bf9
2 changed files with 7 additions and 7 deletions
+5 -5
View File
@@ -366,7 +366,7 @@ func TestProcessEmptyCaps(t *testing.T) {
// Wait for process
waitProcess(&pconfig, t)
outputStatus := string(stdout.Bytes())
outputStatus := stdout.String()
lines := strings.Split(outputStatus, "\n")
@@ -419,7 +419,7 @@ func TestProcessCaps(t *testing.T) {
// Wait for process
waitProcess(&pconfig, t)
outputStatus := string(stdout.Bytes())
outputStatus := stdout.String()
lines := strings.Split(outputStatus, "\n")
@@ -483,7 +483,7 @@ func TestAdditionalGroups(t *testing.T) {
// Wait for process
waitProcess(&pconfig, t)
outputGroups := string(stdout.Bytes())
outputGroups := stdout.String()
// Check that the groups output has the groups that we specified
if !strings.Contains(outputGroups, "audio") {
@@ -1082,7 +1082,7 @@ func TestSysctl(t *testing.T) {
// Wait for process
waitProcess(&pconfig, t)
shmmniOutput := string(bytes.TrimSpace(stdout.Bytes()))
shmmniOutput := strings.TrimSpace(stdout.String())
if shmmniOutput != "8192" {
t.Fatalf("kernel.shmmni property expected to be 8192, but is %s", shmmniOutput)
}
@@ -1210,7 +1210,7 @@ func TestOomScoreAdj(t *testing.T) {
// Wait for process
waitProcess(&pconfig, t)
outputOomScoreAdj := string(bytes.TrimSpace(stdout.Bytes()))
outputOomScoreAdj := strings.TrimSpace(stdout.String())
// Check that the oom_score_adj matches the value that was set as part of config.
if outputOomScoreAdj != strconv.Itoa(*config.OomScoreAdj) {
+2 -2
View File
@@ -188,7 +188,7 @@ func TestExecInAdditionalGroups(t *testing.T) {
stdinW.Close()
waitProcess(process, t)
outputGroups := string(stdout.Bytes())
outputGroups := stdout.String()
// Check that the groups output has the groups that we specified
if !strings.Contains(outputGroups, "audio") {
@@ -471,7 +471,7 @@ func TestExecinPassExtraFiles(t *testing.T) {
stdinW.Close()
waitProcess(process, t)
out := string(stdout.Bytes())
out := stdout.String()
// fd 5 is the directory handle for /proc/$$/fd
if out != "0 1 2 3 4 5" {
t.Fatalf("expected to have the file descriptors '0 1 2 3 4 5' passed to exec, got '%s'", out)