Closed fipso closed 5 years ago
Use a type switch.
@emersion How? Please am really stuck here
@emersion Am sorry am new to Golang I can't figure out what next to do here
switch t := update.(type) {
case *client.MailboxUpdate:
g := &client.MailboxUpdate{}
m := g.Mailbox
fmt.Println(m)
// log.Println("Mail box update")
// case client.MessageUpdate:
// log.Println("Message update")
// case client.ExpungeUpdate:
// log.Println("Expunge update")
// case client.StatusUpdate:
// log.Println(c.Mailbox().Recent)
default:
fmt.Printf("Don't know type %T\n", t)
}
Hello, is there a way to know whether my update object is a MailBox, Expunge or Messages update ?