mirror of
https://github.com/containers/podman.git
synced 2025-09-27 16:54:42 +08:00
Vendor Bulidah 1.11.2
Vendor in Buildah 1.11.2 into libpod/Podman Signed-off-by: TomSweeneyRedHat <tsweeney@redhat.com>
This commit is contained in:
14
vendor/github.com/containers/buildah/util/util.go
generated
vendored
14
vendor/github.com/containers/buildah/util/util.go
generated
vendored
@ -381,3 +381,17 @@ func LogIfNotRetryable(err error, what string) (retry bool) {
|
||||
func LogIfUnexpectedWhileDraining(err error, what string) {
|
||||
logIfNotErrno(err, what, syscall.EINTR, syscall.EAGAIN, syscall.EIO)
|
||||
}
|
||||
|
||||
// TruncateString trims the given string to the provided maximum amount of
|
||||
// characters and shortens it with `...`.
|
||||
func TruncateString(str string, to int) string {
|
||||
newStr := str
|
||||
if len(str) > to {
|
||||
const tr = "..."
|
||||
if to > len(tr) {
|
||||
to -= len(tr)
|
||||
}
|
||||
newStr = str[0:to] + tr
|
||||
}
|
||||
return newStr
|
||||
}
|
||||
|
Reference in New Issue
Block a user