435c0d9fc8
This PR switches the Nomad repository from using govendor to Go modules for managing dependencies. Aspects of the Nomad workflow remain pretty much the same. The usual Makefile targets should continue to work as they always did. The API submodule simply defers to the parent Nomad version on the repository, keeping the semantics of API versioning that currently exists.
20 lines
729 B
Go
20 lines
729 B
Go
package lz4
|
|
|
|
import "errors"
|
|
|
|
var (
|
|
// ErrInvalidSourceShortBuffer is returned by UncompressBlock or CompressBLock when a compressed
|
|
// block is corrupted or the destination buffer is not large enough for the uncompressed data.
|
|
ErrInvalidSourceShortBuffer = errors.New("lz4: invalid source or destination buffer too short")
|
|
// ErrInvalid is returned when reading an invalid LZ4 archive.
|
|
ErrInvalid = errors.New("lz4: bad magic number")
|
|
// ErrBlockDependency is returned when attempting to decompress an archive created with block dependency.
|
|
ErrBlockDependency = errors.New("lz4: block dependency not supported")
|
|
)
|
|
|
|
func recoverBlock(e *error) {
|
|
if recover() != nil && *e == nil {
|
|
*e = ErrInvalidSourceShortBuffer
|
|
}
|
|
}
|