diff --git a/pkg/util/iptables/iptables_test.go b/pkg/util/iptables/iptables_test.go
index <HASH>..<HASH> 100644
--- a/pkg/util/iptables/iptables_test.go
+++ b/pkg/util/iptables/iptables_test.go
@@ -797,8 +797,8 @@ COMMIT
 		t.Fatalf("%s: Expected success, got %v", protocol, err)
 	}
 
-	if string(buffer.Bytes()) != output {
-		t.Errorf("%s: Expected output '%s', got '%v'", protocol, output, string(buffer.Bytes()))
+	if buffer.String() != output {
+		t.Errorf("%s: Expected output '%s', got '%v'", protocol, output, buffer.String())
 	}
 
 	if fcmd.CombinedOutputCalls != 1 {
@@ -817,8 +817,8 @@ COMMIT
 	if err == nil {
 		t.Errorf("%s: Expected failure", protocol)
 	}
-	if string(buffer.Bytes()) != stderrOutput {
-		t.Errorf("%s: Expected output '%s', got '%v'", protocol, stderrOutput, string(buffer.Bytes()))
+	if buffer.String() != stderrOutput {
+		t.Errorf("%s: Expected output '%s', got '%v'", protocol, stderrOutput, buffer.String())
 	}
 }
test: Use bytes.Buffer.String

Fix some warnings from go-staticcheck.

"should use buffer.String() instead of string(buffer.Bytes()) (S<I>)"

This warning is explained at this link.
<URL>