mirror of
https://github.com/lxc/incus
synced 2026-08-02 05:26:46 +00:00
shared/subprocess: Fix gofumpt
Signed-off-by: Stéphane Graber <stgraber@stgraber.org>
This commit is contained in:
parent
11e8c4d69e
commit
ca087ff47d
@ -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)
|
||||
}
|
||||
|
||||
@ -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)
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user