Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

specerror: Add NewRFCError and NewRFCErrorOrPanic #627

Merged
merged 1 commit into from
Apr 24, 2018

Conversation

wking
Copy link
Contributor

@wking wking commented Apr 18, 2018

So we don't have to dance around with casting to extract structured information from NewError's returned error.

@alban
Copy link
Contributor

alban commented Apr 19, 2018

LGTM (but I'm not a maintainer)

// NewRFCErrorOrPanic creates an rfc2119.Error referencing a spec
// violation and panics on failure. This is handy for situations
// where you can't be bothered to check NewRFCError for failure.
func NewRFCErrorOrPanic(code Code, err error, version string) (*rfc2119.Error) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

go fmt fails at this line.
It should be

func NewRFCErrorOrPanic(code Code, err error, version string)  *rfc2119.Error {

@@ -7,6 +7,7 @@ import (
"github.com/mndrix/tap-go"
rspecs "github.com/opencontainers/runtime-spec/specs-go"
"github.com/opencontainers/runtime-tools/specerror"
rfc2119 "github.com/opencontainers/runtime-tools/error"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

go fmt fails at this line.
It should be moved one line up.

         rfc2119 "github.com/opencontainers/runtime-tools/error"
 	"github.com/opencontainers/runtime-tools/specerror"

So we don't have to dance around with casting to extract structured
information from NewError's returned error.

Signed-off-by: W. Trevor King <wking@tremily.us>
@wking
Copy link
Contributor Author

wking commented Apr 19, 2018

I've fixed the.gofmt errors with dac7b677992f01.

@zhouhao3
Copy link

zhouhao3 commented Apr 21, 2018

LGTM

Approved with PullApprove

@zhouhao3 zhouhao3 merged commit 95866ec into opencontainers:master Apr 24, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants