Currently, the LOGIN mechanism is used for both IMAP and SASL. go-sasl will be deprecating the LOGIN mechanism (though we can replace this with PLAIN), and in general it would be better if plaintext password authentication isn't required (though it should still be supported).
go-imap/client can use SASL for authentication through Authenticate, so we could use the OAuthBearer mechanism (Go has an OAuth2 package which should simplify the implementation).
If the password for the account is not specified in the config, OAuth2 authentication should be attempted, but if the password is specified, then it should use PLAIN authentication.