packagematchersimport("reflect""github.com/onsi/gomega/format")typeBeZeroMatcherstruct{}func(matcher*BeZeroMatcher)Match(actualinterface{})(successbool,errerror){ifactual==nil{returntrue,nil}zeroValue:=reflect.Zero(reflect.TypeOf(actual)).Interface()returnreflect.DeepEqual(zeroValue,actual),nil}func(matcher*BeZeroMatcher)FailureMessage(actualinterface{})(messagestring){returnformat.Message(actual,"to be zero-valued")}func(matcher*BeZeroMatcher)NegatedFailureMessage(actualinterface{})(messagestring){returnformat.Message(actual,"not to be zero-valued")}