Skip to content

ExitCoder should implement Unwrap #1090

@Nokel81

Description

@Nokel81

Checklist

  • Are you running the latest v2 release? The list of releases is here.
  • Did you check the manual for your release? The v2 manual is here
  • Did you perform a search about this feature? Here's the Github guide about searching.

What problem does this solve?

In golang v1.13 the notion of error wrapping was introduced with the following optional method signature on error types: func (*T) Unwrap error. The ExitCoder type is very similar to a wrapped error with addition information (the exit code), so it seems like a good addition.

A long term consideration (for this package's v3) might be to change the implementation of ExitCoder to be:

type exitError struct {
	exitCode int
	err      error
}

Metadata

Metadata

Assignees

Labels

area/v2relates to / is being considered for v2help wantedplease help if you can!kind/featuredescribes a code enhancement / feature requeststatus/claimedsomeone has claimed this issuestatus/confirmedconfirmed to be valid, but work has yet to start

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions