During testing I get the error message
Expected
<[]map[string]interface {} | len:0, cap:0>: []
to equal
<[]map[string]interface {} | len:0, cap:0>: nil
How Do i declare a []map[string]interface {} to be "nil"?
thank you
During testing I get the error message
Expected
<[]map[string]interface {} | len:0, cap:0>: []
to equal
<[]map[string]interface {} | len:0, cap:0>: nil
How Do i declare a []map[string]interface {} to be "nil"?
thank you
You can use the gomega matchers like this:
Describe("the test", func() {
var obj []map[string]interface{}
It("should be nil", func() {
Expect(obj).To(BeNil())
})
It("should be empty []", func() {
Expect(obj).To(BeEmpty())
})
})
These tests will pass if the value is not initialized also.
This is how you can declare the map[string]interface{}
to be nil:
var obj []map[string]interface{}
// OR
var obj []map[string]interface{} = nil