Hi all, I have included the following lines of code if b.ConsentProvided { var t string if bl.Status != StatusExpired && bl.Status != StatusCancelled {
t = fmt.Sprintf("Consent to share information by %s", bl.RequestedBy) //lchangetest1 if len(bl.RequestedBy) == 0 { t = "Consent to share information" } } else { t = "Consent to share information" } how to write a test code for this I wrote func TestProvisionhistory(t *testing.T) { bl := BookingListing { Status: "Expired"} var thh = b1.provisionHistory(t.Booking) if thh.Status != StatusExpired && thh.Status != StatusCancelled { t.Error("Fail") } else { t.Error("True") } Booking listing is a struct What am I doing wrong? thanking in advance -- 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 golang-nuts+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/golang-nuts/f09f16a0-5718-4d19-8f37-ba1eaabc723dn%40googlegroups.com.