From f6c0fc1aa854ae5ce73d57ecb09d47c0d4dd2cc3 Mon Sep 17 00:00:00 2001 From: baude Date: Tue, 26 Jun 2018 13:50:12 -0500 Subject: Vendor in latest runtime-tools Newer runtime tools separates syscalls by OS so we can build darwin. Signed-off-by: baude Closes: #1007 Approved by: baude --- .../opencontainers/runtime-tools/error/error.go | 30 ++++++++++++++++++++++ 1 file changed, 30 insertions(+) (limited to 'vendor/github.com/opencontainers/runtime-tools/error') diff --git a/vendor/github.com/opencontainers/runtime-tools/error/error.go b/vendor/github.com/opencontainers/runtime-tools/error/error.go index f5a90800e..f7eac6639 100644 --- a/vendor/github.com/opencontainers/runtime-tools/error/error.go +++ b/vendor/github.com/opencontainers/runtime-tools/error/error.go @@ -86,6 +86,36 @@ func ParseLevel(level string) (Level, error) { return l, fmt.Errorf("%q is not a valid compliance level", level) } +// String takes a RFC 2119 compliance level constant and returns a string representation. +func (level Level) String() string { + switch level { + case May: + return "MAY" + case Optional: + return "OPTIONAL" + case Should: + return "SHOULD" + case ShouldNot: + return "SHOULD NOT" + case Recommended: + return "RECOMMENDED" + case NotRecommended: + return "NOT RECOMMENDED" + case Must: + return "MUST" + case MustNot: + return "MUST NOT" + case Shall: + return "SHALL" + case ShallNot: + return "SHALL NOT" + case Required: + return "REQUIRED" + } + + panic(fmt.Sprintf("%d is not a valid compliance level", level)) +} + // Error returns the error message with specification reference. func (err *Error) Error() string { return fmt.Sprintf("%s\nRefer to: %s", err.Err.Error(), err.Reference) -- cgit v1.2.3-54-g00ecf