| commit | af821c801fb70dc3d178dc3ca0c3d4538f9f29aa | [log] [tgz] |
|---|---|---|
| author | Tim Windelschmidt <tim@monogon.tech> | Tue Apr 23 15:03:52 2024 +0200 |
| committer | Tim Windelschmidt <tim@monogon.tech> | Wed Apr 24 13:15:14 2024 +0000 |
| tree | a5f527030125139c9b09be3c37ea2ee862320ce3 | |
| parent | d5f851bb477638436826adec756fe562db526865 [diff] [blame] |
treewide: replace error assertions with errors.As Change-Id: I369cc1dd8f745203f6f24093049d60d971acdf11 Reviewed-on: https://review.monogon.dev/c/monogon/+/3038 Reviewed-by: Serge Bazanski <serge@monogon.tech> Tested-by: Jenkins CI
diff --git a/metropolis/node/build/mkpayload/mkpayload.go b/metropolis/node/build/mkpayload/mkpayload.go index aee3a81..a66d458 100644 --- a/metropolis/node/build/mkpayload/mkpayload.go +++ b/metropolis/node/build/mkpayload/mkpayload.go
@@ -20,6 +20,7 @@ package main import ( + "errors" "flag" "fmt" "io" @@ -179,7 +180,8 @@ return } // Exit with objcopy's return code. - if e, ok := err.(*exec.ExitError); ok { + var e *exec.ExitError + if errors.As(err, &e) { os.Exit(e.ExitCode()) } log.Fatalf("Could not start command: %v", err)