diff options
author | OpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com> | 2019-08-01 12:55:19 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-08-01 12:55:19 +0200 |
commit | ee15e76da0a032bad7cb94295dc32e2553f10850 (patch) | |
tree | 5fd414e27814eba6a57c8cb34cc86b71f85c20c7 /vendor/github.com/DataDog/zstd/errors.go | |
parent | 5056964d09c5de31e10bb226acdb9cb24dce84e9 (diff) | |
parent | 9d6dce119949d340ebb42becae018a3c11148690 (diff) | |
download | podman-ee15e76da0a032bad7cb94295dc32e2553f10850.tar.gz podman-ee15e76da0a032bad7cb94295dc32e2553f10850.tar.bz2 podman-ee15e76da0a032bad7cb94295dc32e2553f10850.zip |
Merge pull request #3675 from rhatdan/storage
Vendor in containers/storage v1.12.16
Diffstat (limited to 'vendor/github.com/DataDog/zstd/errors.go')
-rw-r--r-- | vendor/github.com/DataDog/zstd/errors.go | 35 |
1 files changed, 0 insertions, 35 deletions
diff --git a/vendor/github.com/DataDog/zstd/errors.go b/vendor/github.com/DataDog/zstd/errors.go deleted file mode 100644 index 38db0d51c..000000000 --- a/vendor/github.com/DataDog/zstd/errors.go +++ /dev/null @@ -1,35 +0,0 @@ -package zstd - -/* -#define ZSTD_STATIC_LINKING_ONLY -#include "zstd.h" -*/ -import "C" - -// ErrorCode is an error returned by the zstd library. -type ErrorCode int - -// Error returns the error string given by zstd -func (e ErrorCode) Error() string { - return C.GoString(C.ZSTD_getErrorName(C.size_t(e))) -} - -func cIsError(code int) bool { - return int(C.ZSTD_isError(C.size_t(code))) != 0 -} - -// getError returns an error for the return code, or nil if it's not an error -func getError(code int) error { - if code < 0 && cIsError(code) { - return ErrorCode(code) - } - return nil -} - -// IsDstSizeTooSmallError returns whether the error correspond to zstd standard sDstSizeTooSmall error -func IsDstSizeTooSmallError(e error) bool { - if e != nil && e.Error() == "Destination buffer is too small" { - return true - } - return false -} |