Screw it, let functions take only one argument instead of requiring two

This commit is contained in:
Tianon Gravi 2016-06-02 17:05:15 -07:00
parent e55c34e8a6
commit e4fd05106a
1 changed files with 2 additions and 2 deletions

View File

@ -15,8 +15,8 @@ func swapStringsFuncBoolArgsOrder(a func(string, string) bool) func(string, stri
func stringsActionFactory(name string, actOnFirst bool, action func([]string, string) string) func(args ...interface{}) string {
return func(args ...interface{}) string {
if len(args) < 2 {
panic(fmt.Sprintf(`%q requires at least two arguments`, name))
if len(args) < 1 {
panic(fmt.Sprintf(`%q requires at least one argument`, name))
}
var str string