lint: fix warnings found by perfsprint

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
This commit is contained in:
Paul Holzinger
2023-10-20 16:21:12 +02:00
parent 64f43fed4d
commit 29273cda10
24 changed files with 62 additions and 53 deletions

View File

@ -1,8 +1,8 @@
package systemd
import (
"fmt"
"os"
"strconv"
"testing"
"github.com/stretchr/testify/assert"
@ -18,7 +18,7 @@ func TestSocketActivated(t *testing.T) {
assert.False(SocketActivated())
// same pid no fds
assert.NoError(os.Setenv("LISTEN_PID", fmt.Sprintf("%d", os.Getpid())))
assert.NoError(os.Setenv("LISTEN_PID", strconv.Itoa(os.Getpid())))
assert.NoError(os.Setenv("LISTEN_FDS", "0"))
assert.False(SocketActivated())

View File

@ -500,7 +500,7 @@ func executeContainerTemplate(info *containerInfo, options entities.GenerateSyst
}
if info.GenerateTimestamp {
info.TimeStamp = fmt.Sprintf("%v", time.Now().Format(time.UnixDate))
info.TimeStamp = time.Now().Format(time.UnixDate)
}
// Sort the slices to assure a deterministic output.
sort.Strings(info.BoundToServices)

View File

@ -384,7 +384,7 @@ func executePodTemplate(info *podInfo, options entities.GenerateSystemdOptions)
}
if info.GenerateTimestamp {
info.TimeStamp = fmt.Sprintf("%v", time.Now().Format(time.UnixDate))
info.TimeStamp = time.Now().Format(time.UnixDate)
}
// Sort the slices to assure a deterministic output.