shared/subprocess: Fix gofumpt

Signed-off-by: Stéphane Graber <stgraber@stgraber.org>
This commit is contained in:
Stéphane Graber 2025-03-17 18:07:23 -04:00
parent 11e8c4d69e
commit ca087ff47d
No known key found for this signature in database
GPG Key ID: C638974D64792D67
2 changed files with 4 additions and 5 deletions

View File

@ -16,7 +16,6 @@ func TestSignalHandling(t *testing.T) {
a = append(a, "testscript/signal.sh")
var file *os.File
p, err := NewProcess("sh", a, "testscript/signal_out.txt", "")
if err != nil {
t.Error("Failed process creation: ", err)
}
@ -45,14 +44,14 @@ func TestSignalHandling(t *testing.T) {
t.Error("Exit code is not 1: ", ecode)
}
file, err = os.OpenFile("testscript/signal_out.txt", os.O_RDWR, 0644)
file, err = os.OpenFile("testscript/signal_out.txt", os.O_RDWR, 0o644)
if err != nil {
t.Error("Could not open file ", err)
}
defer func() { _ = file.Close() }()
var text = make([]byte, 1024)
text := make([]byte, 1024)
for {
_, err = file.Read(text)
// Break if finally arrived at end of file
@ -156,7 +155,7 @@ func TestProcessStartWaitExit(t *testing.T) {
t.Error("Exit code is not 1: ", ecode)
}
file, err = os.OpenFile("testscript/out.txt", os.O_RDWR, 0644)
file, err = os.OpenFile("testscript/out.txt", os.O_RDWR, 0o644)
if err != nil {
t.Error("Could not open file: ", err)
}

View File

@ -271,7 +271,7 @@ func (p *Process) Save(path string) error {
return fmt.Errorf("Unable to serialize process struct to YAML: %w", err)
}
err = os.WriteFile(path, dat, 0644)
err = os.WriteFile(path, dat, 0o644)
if err != nil {
return fmt.Errorf("Unable to write to file '%s': %w", path, err)
}