]> Cypherpunks repositories - gostls13.git/commit
text/template: clarify error when too few or too many return values
authorDmitri Shuralyov <dmitshur@golang.org>
Fri, 24 May 2024 21:56:31 +0000 (17:56 -0400)
committerGopher Robot <gobot@golang.org>
Fri, 24 May 2024 22:23:55 +0000 (22:23 +0000)
commit377646589d5fb0224014683e0d1f1db35e60c3ac
tree7fc4a15a6760ae809ffcf55cb8028e8af28c188a
parenta2eae66c3010efc507afca9f1f53fb7cf4d5671c
text/template: clarify error when too few or too many return values

Prior to CL 561115, calling a function without any return values would
print "function called with 0 args; should be 1 or 2". Afterwards, the
error message became "too many return values".

Keep the improvement of referring to return values rather than args,
and bring back clarity about their actual and permitted numbers.

Change-Id: I2c014e4633208cc7052fac265a995a8f2fe68151
Reviewed-on: https://go-review.googlesource.com/c/go/+/588355
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
Auto-Submit: Dmitri Shuralyov <dmitshur@golang.org>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
src/text/template/exec_test.go
src/text/template/funcs.go