Ensure org name in the import path is always NYTimes#76
Conversation
This is in prep for the org rename.
| @@ -1,4 +1,4 @@ | |||
| package gziphandler | |||
| package gziphandler // import "github.com/NYTimes/gziphandler" | |||
There was a problem hiding this comment.
do we need this vanity import? Pretty sure I think Go Modules ignores it and the old Go will freak out anyway if a user did lower case "get"
There was a problem hiding this comment.
@marwan-at-work because gziphandler doesn't have sub-packages, there's nothing enforcing what case is used in the import path.
Before this change:
% docker run golang go get -v github.com/nytimes/gziphandler
github.com/nytimes/gziphandler (download)
github.com/nytimes/gziphandler
% docker run golang go get -v github.com/NYTimes/gziphandler
github.com/NYTimes/gziphandler (download)
github.com/NYTimes/gziphandler
Using the CASE-fold org, where the canonical import path is declared:
% docker run golang go get -v github.com/CASE-fold/gziphandler
github.com/CASE-fold/gziphandler (download)
package github.com/CASE-fold/gziphandler: code in directory /go/src/github.com/CASE-fold/gziphandler expects import "github.com/case-fold/gziphandler"
% docker run golang go get -v github.com/case-fold/gziphandler
github.com/case-fold/gziphandler (download)
github.com/case-fold/gziphandler
There was a problem hiding this comment.
(same thing applies to dep)
There was a problem hiding this comment.
Oh I see, the lack of sub packages makes the import path work both ways...maybe that's a good thing 😄
There was a problem hiding this comment.
Not really, because every package in a build have to agree on the import path, so if one of your dependencies wants to use nytimes while others want to use NYTimes, you're busted.
This is what happened to logrus: while it does have sub-packages, the package github.com/sirupsen/logrus doesn't depend on any of the them. The internet crashed once some packages started using sirupsen while others were still using Sirupsen.
Same as nytimes/gziphandler#76. Also giving the travis.yml file some love.
Same as nytimes/gziphandler#76. Also giving the travis.yml file some love.
Fun times are coming.