pkg/util/iptables: use buf.String() instead of string(buf.Bytes())

Signed-off-by: TommyStarK <thomasmilox@gmail.com>
This commit is contained in:
TommyStarK
2023-06-04 15:52:44 +02:00
parent eca1f9d2d5
commit 1fcfd1d509
4 changed files with 14 additions and 9 deletions

View File

@@ -483,6 +483,11 @@ func (buf *LineBuffer) Bytes() []byte {
return buf.b.Bytes()
}
// String returns the contents of buf as a string
func (buf *LineBuffer) String() string {
return buf.b.String()
}
// Lines returns the number of lines in buf. Note that more precisely, this returns the
// number of times Write() or WriteBytes() was called; it assumes that you never wrote
// any newlines to the buffer yourself.