sandbox: return error on doubled start
All checks were successful
Test / Create distribution (push) Successful in 18s
Test / Fpkg (push) Successful in 35s
Test / Fortify (push) Successful in 38s
Test / Data race detector (push) Successful in 36s
Test / Flake checks (push) Successful in 58s

Signed-off-by: Ophestra <cat@gensokyo.uk>
This commit is contained in:
Ophestra 2025-03-15 03:30:14 +09:00
parent e64e7608ca
commit 4230281194
Signed by: cat
SSH Key Fingerprint: SHA256:gQ67O0enBZ7UdZypgtspB2FDM1g3GVw8nX0XSdcFw8Q

View File

@ -3,6 +3,7 @@ package sandbox
import (
"context"
"encoding/gob"
"errors"
"fmt"
"io"
"os"
@ -111,7 +112,7 @@ type (
func (p *Container) Start() error {
if p.cmd != nil {
panic("attempted to start twice")
return errors.New("sandbox: already started")
}
c, cancel := context.WithCancel(p.ctx)