mirror of
https://github.com/go-task/task.git
synced 2026-08-29 10:08:27 +02:00
chore: bump minimum Go to 1.26 and adopt 1.26 features (#2920)
This commit is contained in:
@@ -48,12 +48,10 @@ func (err *TaskRunError) Code() int {
|
||||
}
|
||||
|
||||
func (err *TaskRunError) TaskExitCode() int {
|
||||
var exit interp.ExitStatus
|
||||
if errors.As(err.Err, &exit) {
|
||||
if exit, ok := errors.AsType[interp.ExitStatus](err.Err); ok {
|
||||
return int(exit)
|
||||
}
|
||||
var timeout *TaskTimeoutError
|
||||
if errors.As(err.Err, &timeout) {
|
||||
if _, ok := errors.AsType[*TaskTimeoutError](err.Err); ok {
|
||||
return TimeoutExitCode
|
||||
}
|
||||
return err.Code()
|
||||
|
||||
Reference in New Issue
Block a user