container/executable: handle nil msg
All checks were successful
Test / Create distribution (push) Successful in 33s
Test / Sandbox (push) Successful in 2m10s
Test / Hakurei (push) Successful in 3m4s
Test / Sandbox (race detector) (push) Successful in 3m59s
Test / Hpkg (push) Successful in 4m2s
Test / Hakurei (race detector) (push) Successful in 4m45s
Test / Flake checks (push) Successful in 1m37s
All checks were successful
Test / Create distribution (push) Successful in 33s
Test / Sandbox (push) Successful in 2m10s
Test / Hakurei (push) Successful in 3m4s
Test / Sandbox (race detector) (push) Successful in 3m59s
Test / Hpkg (push) Successful in 4m2s
Test / Hakurei (race detector) (push) Successful in 4m45s
Test / Flake checks (push) Successful in 1m37s
This is useful in some tests. Signed-off-by: Ophestra <cat@gensokyo.uk>
This commit is contained in:
parent
4f41afee0f
commit
e9d00b9071
@ -1,6 +1,8 @@
|
||||
package container
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"log"
|
||||
"os"
|
||||
"sync"
|
||||
|
||||
@ -14,8 +16,13 @@ var (
|
||||
|
||||
func copyExecutable(msg message.Msg) {
|
||||
if name, err := os.Executable(); err != nil {
|
||||
msg.BeforeExit()
|
||||
msg.GetLogger().Fatalf("cannot read executable path: %v", err)
|
||||
m := fmt.Sprintf("cannot read executable path: %v", err)
|
||||
if msg != nil {
|
||||
msg.BeforeExit()
|
||||
msg.GetLogger().Fatal(m)
|
||||
} else {
|
||||
log.Fatal(m)
|
||||
}
|
||||
} else {
|
||||
executable = name
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user