mxk / go-imap

IMAP4rev1 Client for Go
BSD 3-Clause "New" or "Revised" License
212 stars 63 forks source link

Repo renaming #5

Closed xarg closed 10 years ago

xarg commented 10 years ago

Currently in order to import this package one needs to do this:

import "github.com/mxk/go-imap/imap"

Imho this is a bit ugly and doesn't work well with the go get command as it expects the package to be in the root of the repo. I suggest renaming the package name to a nicer:

import "github.com/mxk/imap"

Dropping 'go-' from the name might be a bit confusing for people looking for imap libs from other languages, but I think that confusion will be quickly removed as soon as they see that it's written in go.

Andrew Gerrand had a similar suggestion in his talk here: http://talks.golang.org/2014/names.slide#17

mxk commented 10 years ago

Renaming the package will break existing code, so it's not going to happen. I'm also not aware of any go get requirement to have the package in the root of the repo. Where did you hear that?

Andrews's example is not a very good one. You'll notice that his github link has "golang" as the user or organization, which makes it clear what "oauth2" is. That's not the case for personal repositories and I may want to have a separate py-imap repository later on. Google Code operates at the project level, so what are the odds that /p/oauth2 isn't already taken? You're going to need a unique project name, which is not going to be oauth2, and then you need to satisfy the other requirement to have the last path component match the package name. That's how you end up with goauth2/oauth2.

xarg commented 10 years ago

Fair enough. For go get this is not a requirement - I meant I expected it to be in root. It's a convention I observed. A lot of packages have this pattern: go get github.com/owner/packagename where packagename is the same one as the package packagename. In go-imap's case:

go get github.com/mxk/go-imap
package github.com/mxk/go-imap
    imports github.com/mxk/go-imap
    imports github.com/mxk/go-imap: no buildable Go source files in /home/q/src/github.com/mxk/go-imap

A bit ugly, but not the end of the world.

I really don't want to insist on this as it's not vital. As long as it's clear what the user has to do it's fine with me.