Update go version

This commit is contained in:
dwrz
2026-08-21 10:23:37 +00:00
parent 78248a6145
commit c2e2d9ea02
466 changed files with 67766 additions and 2881 deletions

View File

@@ -6,6 +6,7 @@ package main
import (
"context"
"errors"
"fmt"
"os"
@@ -23,11 +24,20 @@ func main() {
if err == nil {
err = cmd.Wait()
}
switch err := err.(type) {
case nil:
case interface{ ExitCode() int }:
os.Exit(err.ExitCode())
default:
if err != nil {
var e interface{ ExitCode() int }
if errors.As(err, &e) {
printErrorToStderr := true
if _, ok := err.(interface{ ExitCode() int }); ok {
// Avoid printing the error to stderr if the exit code error wasn't
// wrapped with another error providing context.
printErrorToStderr = false
}
if printErrorToStderr {
fmt.Fprintln(os.Stderr, err)
}
os.Exit(e.ExitCode())
}
fmt.Fprintln(os.Stderr, err)
os.Exit(1)
}