aboutsummaryrefslogtreecommitdiff
path: root/vendor/github.com/opencontainers/runtime-tools/error
diff options
context:
space:
mode:
authorbaude <bbaude@redhat.com>2018-06-26 13:50:12 -0500
committerAtomic Bot <atomic-devel@projectatomic.io>2018-06-27 15:16:02 +0000
commitf6c0fc1aa854ae5ce73d57ecb09d47c0d4dd2cc3 (patch)
tree55a2c6e560625df8b8e176e4ac9cb2214480d3ab /vendor/github.com/opencontainers/runtime-tools/error
parent19f5a504ffb1470991f331db412be456e41caab5 (diff)
downloadpodman-f6c0fc1aa854ae5ce73d57ecb09d47c0d4dd2cc3.tar.gz
podman-f6c0fc1aa854ae5ce73d57ecb09d47c0d4dd2cc3.tar.bz2
podman-f6c0fc1aa854ae5ce73d57ecb09d47c0d4dd2cc3.zip
Vendor in latest runtime-tools
Newer runtime tools separates syscalls by OS so we can build darwin. Signed-off-by: baude <bbaude@redhat.com> Closes: #1007 Approved by: baude
Diffstat (limited to 'vendor/github.com/opencontainers/runtime-tools/error')
-rw-r--r--vendor/github.com/opencontainers/runtime-tools/error/error.go30
1 files changed, 30 insertions, 0 deletions
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)