mirror of
https://github.com/docker/cli.git
synced 2026-01-13 18:22:35 +03:00
cli/command/service/progress: define const for magic value
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
@@ -273,8 +273,9 @@ func truncError(errMsg string) string {
|
||||
|
||||
// Limit the length to 75 characters, so that even on narrow terminals
|
||||
// this will not overflow to the next line.
|
||||
if len(errMsg) > 75 {
|
||||
errMsg = errMsg[:74] + "…"
|
||||
const maxWidth = 75
|
||||
if len(errMsg) > maxWidth {
|
||||
errMsg = errMsg[:maxWidth-1] + "…"
|
||||
}
|
||||
return errMsg
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user