mirror of
https://github.com/ceph/ceph-csi.git
synced 2025-06-13 02:33:34 +00:00
build: address gocritic
warnings
Signed-off-by: Niels de Vos <ndevos@ibm.com>
This commit is contained in:
committed by
mergify[bot]
parent
4e6675df76
commit
53c94efc02
@ -29,7 +29,7 @@ func GzipLogFile(pathToFile string) error {
|
||||
}
|
||||
|
||||
// Replace .log extension with .gz extension.
|
||||
newExt := strings.Replace(pathToFile, ".log", ".gz", -1)
|
||||
newExt := strings.ReplaceAll(pathToFile, ".log", ".gz")
|
||||
|
||||
// Open file for writing.
|
||||
gf, err := os.OpenFile(newExt, os.O_CREATE|os.O_RDWR|os.O_TRUNC, 0o644) // #nosec:G304,G302, file inclusion & perms
|
||||
|
@ -37,7 +37,7 @@ func TestGzipLogFile(t *testing.T) {
|
||||
t.Errorf("GzipLogFile failed: %v", err)
|
||||
}
|
||||
|
||||
newExt := strings.Replace(logFile.Name(), ".log", ".gz", -1)
|
||||
newExt := strings.ReplaceAll(logFile.Name(), ".log", ".gz")
|
||||
if _, err = os.Stat(newExt); errors.Is(err, os.ErrNotExist) {
|
||||
t.Errorf("compressed logFile (%s) not found: %v", newExt, err)
|
||||
}
|
||||
|
Reference in New Issue
Block a user