Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compilation error #5

Closed
faide opened this issue Dec 8, 2017 · 2 comments
Closed

Compilation error #5

faide opened this issue Dec 8, 2017 · 2 comments

Comments

@faide
Copy link

faide commented Dec 8, 2017

Hi,

the current code does not compile. Most certainly because of an updated underlying library.

If I understand what is going on, it seems the go-imap-proxy code tries to use (go-imap-proxy/mailbox.go:16) the m.u.c.Mailbox function as a struct. So go-imap-proxy seems to be the culprit here.

That is the first error. Did not look at the others though.

Are you still interested by that code ? (ie: would you be interested in some help ?)

When I try to compile from a fresh clone I get the following errors:

# github.com/emersion/go-imap-proxy
../../go-imap-proxy/mailbox.go:16: m.u.c.Mailbox.Name undefined (type func() *imap.MailboxStatus has no field or method Name)
../../go-imap-proxy/mailbox.go:33: m.u.c.Mailbox.Name undefined (type func() *imap.MailboxStatus has no field or method Name)
../../go-imap-proxy/mailbox.go:34: invalid indirect of m.u.c.Mailbox (type func() *imap.MailboxStatus)
../../go-imap-proxy/mailbox.go:38: cannot use items (type []string) as type []imap.StatusItem in argument to m.u.c.Status
../../go-imap-proxy/mailbox.go:68: cannot use items (type []string) as type []imap.FetchItem in argument to m.u.c.UidFetch
../../go-imap-proxy/mailbox.go:70: cannot use items (type []string) as type []imap.FetchItem in argument to m.u.c.Fetch
../../go-imap-proxy/mailbox.go:103: cannot use string(operation) (type string) as type imap.StoreItem in argument to m.u.c.UidStore
../../go-imap-proxy/mailbox.go:105: cannot use string(operation) (type string) as type imap.StoreItem in argument to m.u.c.Store
../../go-imap-proxy/user.go:34: cannot use mailbox literal (type *mailbox) as type backend.Mailbox in append:
	*mailbox does not implement backend.Mailbox (wrong type for ListMessages method)
		have ListMessages(bool, *imap.SeqSet, []string, chan<- *imap.Message) error
		want ListMessages(bool, *imap.SeqSet, []imap.FetchItem, chan<- *imap.Message) error
../../go-imap-proxy/user.go:54: impossible type assertion:
	*mailbox does not implement backend.Mailbox (wrong type for ListMessages method)
		have ListMessages(bool, *imap.SeqSet, []string, chan<- *imap.Message) error
		want ListMessages(bool, *imap.SeqSet, []imap.FetchItem, chan<- *imap.Message) error
../../go-imap-proxy/user.go:54: too many errors
# github.com/emersion/go-pgpmail/imap
../../go-pgpmail/imap/mailbox.go:26: cannot use item (type string) as type imap.FetchItem in argument to imap.ParseBodySectionName
../../go-pgpmail/imap/mailbox.go:32: cannot use items (type []string) as type []imap.FetchItem in argument to m.Mailbox.ListMessages
../../go-pgpmail/imap/mailbox.go:64: cannot use items (type []string) as type []imap.FetchItem in argument to m.Mailbox.ListMessages
../../go-pgpmail/imap/user.go:24: cannot use u.getMailbox(m) (type *mailbox) as type backend.Mailbox in assignment:
	*mailbox does not implement backend.Mailbox (wrong type for ListMessages method)
		have ListMessages(bool, *imap.SeqSet, []string, chan<- *imap.Message) error
		want ListMessages(bool, *imap.SeqSet, []imap.FetchItem, chan<- *imap.Message) error
../../go-pgpmail/imap/user.go:34: cannot use u.getMailbox(m) (type *mailbox) as type backend.Mailbox in return argument:
	*mailbox does not implement backend.Mailbox (wrong type for ListMessages method)
		have ListMessages(bool, *imap.SeqSet, []string, chan<- *imap.Message) error
		want ListMessages(bool, *imap.SeqSet, []imap.FetchItem, chan<- *imap.Message) error
@faide
Copy link
Author

faide commented Dec 12, 2017

I have looked a bit into this and proposed:

emersion/go-imap-proxy#4
emersion/go-pgpmail#2

with those 2 PRs applied to their respective repositories, maddy compiles without error

Cheers

@emersion
Copy link
Collaborator

Awesome, thanks a lot!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants