tests: avoid sprint for simple string concatination

This commit is contained in:
Jörg Thalheim 2024-11-20 09:20:00 +01:00
parent f57a556af4
commit 14753257fb
2 changed files with 3 additions and 2 deletions

View file

@ -4,6 +4,7 @@
package main
import (
"errors"
"fmt"
"os"
@ -13,7 +14,7 @@ import (
func RuntimeDir() (string, error) {
rundir, ok := os.LookupEnv("XDG_RUNTIME_DIR")
if !ok {
return "", fmt.Errorf("$XDG_RUNTIME_DIR is not set")
return "", errors.New("$XDG_RUNTIME_DIR is not set")
}
return rundir, nil
}

View file

@ -94,7 +94,7 @@ func TestGPG(t *testing.T) { //nolint:paralleltest
testdir := newTestDir(t)
defer testdir.Remove()
gpgHome := path.Join(testdir.path, "gpg-home")
gpgEnv := append(os.Environ(), fmt.Sprintf("GNUPGHOME=%s", gpgHome))
gpgEnv := append(os.Environ(), "GNUPGHOME="+gpgHome)
ok(t, os.Mkdir(gpgHome, os.FileMode(0o700)))