diff --git a/command/helpers.go b/command/helpers.go index 489b3fb5e..d7b18242b 100644 --- a/command/helpers.go +++ b/command/helpers.go @@ -8,6 +8,7 @@ import ( // aligned k = v pairs using the columnize library. func formatKV(in []string) string { columnConf := columnize.DefaultConfig() + columnConf.Empty = "" columnConf.Glue = " = " return columnize.Format(in, columnConf) } diff --git a/command/helpers_test.go b/command/helpers_test.go index 24f6fbee5..327c41712 100644 --- a/command/helpers_test.go +++ b/command/helpers_test.go @@ -5,11 +5,12 @@ import ( ) func TestHelpers_FormatKV(t *testing.T) { - in := []string{"alpha|beta", "charlie|delta"} + in := []string{"alpha|beta", "charlie|delta", "echo|"} out := formatKV(in) expect := "alpha = beta\n" - expect += "charlie = delta" + expect += "charlie = delta\n" + expect += "echo = " if out != expect { t.Fatalf("expect: %s, got: %s", expect, out)