From 0cac40226341a9632fea18a6049a7ccf83c69416 Mon Sep 17 00:00:00 2001 From: Qi Xiao Date: Mon, 22 Feb 2016 18:23:12 +0100 Subject: [PATCH] eval: Teach (*muster).error correct English --- eval/must.go | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/eval/must.go b/eval/must.go index 3093be6f..0b7b3d96 100644 --- a/eval/must.go +++ b/eval/must.go @@ -1,7 +1,6 @@ package eval import ( - "fmt" "strconv" "github.com/elves/elvish/parse" @@ -25,7 +24,11 @@ func (ec *EvalCtx) must(vs []Value, what string, begin, end int) *muster { func (m *muster) mustLen(l int) { if len(m.vs) != l { - m.error(fmt.Sprintf("%d values", l), "%d", len(m.vs)) + if l == 1 { + m.error("1 value", "%d", len(m.vs)) + } else { + m.error(strconv.Itoa(l)+" values", "%d", len(m.vs)) + } } }