Probably the main problem is your "untypedness"
of the test case struct:
[]struct {
par interface{}
want interface{}
err error
}{
Go is a typed language and works very well if the type
system is used. Trying to write untyped (generic) code
results in major complications.
V.
On Sunday, 21 May 2017 22:24:15 UTC+2, Mark Lawrence wrote:
>
> On Sunday, May 21, 2017 at 5:57:26 PM UTC+1, Ian Davis wrote:
>>
>> On Sun, 21 May 2017, at 05:32 PM, [email protected] wrote:
>>
>>
>> On Sunday, May 21, 2017 at 11:52:41 AM UTC+1, Tamás Gulácsi wrote:
>>
>> A nil does not have type
>> A nil interface may have. See http://spf13.com/post/when-nil-is-not-nil/
>>
>> Why don't you use type switch?
>>
>>
>> I've no idea what you're talking about. I want to know why I get, e.g :-
>>
>> mytest_test.go:25: got <nil> '-1' is out of range; want <nil> '-1' is out
>> of range
>>
>>
>> I suspect it's because you return an error created with fmt.Errorf and
>> compare it to a different error created with errors.New. They are pointers
>> to different instances.
>>
>>
>> Ian
>>
>
> In which case I give up, I want to write code, not fart arse around
> because "They are pointers to different instances". Bye bye golang, I'm
> off to find a languange in which I can be productive
>
> Kindest regards.
>
> Mark Lawrence.
>
--
You received this message because you are subscribed to the Google Groups
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.