summaryrefslogtreecommitdiff
path: root/test/utils
diff options
context:
space:
mode:
authorSascha Grunert <sgrunert@suse.com>2020-08-03 09:13:04 +0200
committerSascha Grunert <sgrunert@suse.com>2020-08-03 09:13:04 +0200
commitfef3e2da6a2024fff5142b5df80aba36e895ed73 (patch)
tree5eb2d1ec59719abd82b9114e0c30ae518e444a76 /test/utils
parentbfd34542f463b7ea59b9560516b3b3d66674eefe (diff)
downloadpodman-fef3e2da6a2024fff5142b5df80aba36e895ed73.tar.gz
podman-fef3e2da6a2024fff5142b5df80aba36e895ed73.tar.bz2
podman-fef3e2da6a2024fff5142b5df80aba36e895ed73.zip
Remove some unnecessary []byte to string conversions
Some calls to `Sprintf("%s")` can be avoided by using direct string type assertions. Signed-off-by: Sascha Grunert <sgrunert@suse.com>
Diffstat (limited to 'test/utils')
-rw-r--r--test/utils/utils.go6
1 files changed, 3 insertions, 3 deletions
diff --git a/test/utils/utils.go b/test/utils/utils.go
index 0597cd292..2c454f532 100644
--- a/test/utils/utils.go
+++ b/test/utils/utils.go
@@ -215,7 +215,7 @@ func (s *PodmanSession) OutputToString() string {
// where each array item is a line split by newline
func (s *PodmanSession) OutputToStringArray() []string {
var results []string
- output := fmt.Sprintf("%s", s.Out.Contents())
+ output := string(s.Out.Contents())
for _, line := range strings.Split(output, "\n") {
if line != "" {
results = append(results, line)
@@ -226,14 +226,14 @@ func (s *PodmanSession) OutputToStringArray() []string {
// ErrorToString formats session stderr to string
func (s *PodmanSession) ErrorToString() string {
- fields := strings.Fields(fmt.Sprintf("%s", s.Err.Contents()))
+ fields := strings.Fields(string(s.Err.Contents()))
return strings.Join(fields, " ")
}
// ErrorToStringArray returns the stderr output as a []string
// where each array item is a line split by newline
func (s *PodmanSession) ErrorToStringArray() []string {
- output := fmt.Sprintf("%s", s.Err.Contents())
+ output := string(s.Err.Contents())
return strings.Split(output, "\n")
}