From d6863491da5d70424a7a8b6e37613c1022cdf27b Mon Sep 17 00:00:00 2001 From: Mat Ryer Date: Tue, 30 Apr 2013 10:40:31 -0600 Subject: [PATCH] fixed bug in String --- mock/mock.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/mock/mock.go b/mock/mock.go index 05e8096..ae3462b 100644 --- a/mock/mock.go +++ b/mock/mock.go @@ -421,10 +421,11 @@ func (args Arguments) String(indexOrNil ...int) string { panic(fmt.Sprintf("assert: arguments: String(%d) failed because object wasn't correct type: %s", index, args.Get(index))) } return s - } else { - panic(fmt.Sprintf("assert: arguments: Wrong number of arguments passed to String. Must be 0 or 1, not %d", len(indexOrNil))) } + panic(fmt.Sprintf("assert: arguments: Wrong number of arguments passed to String. Must be 0 or 1, not %d", len(indexOrNil))) + return "" + } // Int gets the argument at the specified index. Panics if there is no argument, or