Skip to content

Conversation

@lukaszb
Copy link

@lukaszb lukaszb commented Jan 21, 2016

No description provided.

@marcosnils
Copy link
Member

@lukaszb thanks for the contribution. I like the idea of adding these type of assertions but we need to make sure to catch nil structs as well. I.E:

var nilStruct struct{}
g.It("IsNil should trigger", func() {
    g.Assert(nilStruct).IsNil()
})

Currently this fails, It'd be nice if we could catch these scenarios also.

@lukaszb
Copy link
Author

lukaszb commented Jan 21, 2016

@marcosnils sure, can do that. btw, can you look at travis failed build? It seems to fail for code I haven't actually touched.

@ammario
Copy link

ammario commented Sep 16, 2016

var nilStruct struct{}

This struct is zeroed, not nil (only pointers can be nil) so the behavior could be misleading.

IsZero() / IsNotZero() are probably better names for this more flexible functionality.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants