There is a small bug in the list example.
Output of the example was:
Connecting to server...
Connected
Logged in
Mailbox "INBOX" contains 0xc00043c058 messages (0xc00043c070 unseen)
after this change:
Connecting to server...
Connected
Logged in
Mailbox "INBOX" contains 369 messages (154 unseen)
Closes: https://github.com/emersion/go-imap/issues/737