From 30a0d0c6d6df4d98d48477e96326329655a9fd7a Mon Sep 17 00:00:00 2001 From: Sebastiaan van Stijn Date: Mon, 28 Nov 2022 16:27:45 +0100 Subject: [PATCH] cli/command/formatter: define const for error column-headers Signed-off-by: Sebastiaan van Stijn --- cli/command/formatter/custom.go | 1 + cli/command/task/formatter.go | 3 +-- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/cli/command/formatter/custom.go b/cli/command/formatter/custom.go index 1d78ce62e2..2d6c979c32 100644 --- a/cli/command/formatter/custom.go +++ b/cli/command/formatter/custom.go @@ -16,6 +16,7 @@ const ( StatusHeader = "STATUS" PortsHeader = "PORTS" ImageHeader = "IMAGE" + ErrorHeader = "ERROR" ContainerIDHeader = "CONTAINER ID" ) diff --git a/cli/command/task/formatter.go b/cli/command/task/formatter.go index 0958a1e89e..64509abbea 100644 --- a/cli/command/task/formatter.go +++ b/cli/command/task/formatter.go @@ -20,7 +20,6 @@ const ( taskIDHeader = "ID" desiredStateHeader = "DESIRED STATE" currentStateHeader = "CURRENT STATE" - errorHeader = "ERROR" maxErrLength = 30 ) @@ -61,7 +60,7 @@ func FormatWrite(ctx formatter.Context, tasks []swarm.Task, names map[string]str "Node": nodeHeader, "DesiredState": desiredStateHeader, "CurrentState": currentStateHeader, - "Error": errorHeader, + "Error": formatter.ErrorHeader, "Ports": formatter.PortsHeader, } return ctx.Write(&taskCtx, render)