temoto / robotstxt

The robots.txt exclusion protocol implementation for Go language
MIT License
269 stars 55 forks source link

Change import statement or change package name #16

Closed sudotliu closed 8 years ago

sudotliu commented 8 years ago

The discrepancy between the package name and the suggested import statement is potentially confusing and problematic.

The suggested import path is "github.com/temoto/robotstxt.go", which implies that the go get call should be for the same path.

This becomes a bit of a problem when testing packages individually because go test robotstxt.go will think we're referencing a file when we're really referencing a directory. Workarounds include using a get and import path that reflect the real package name i.e. keep the dash or to append a slash to the test command i.e. go test robotstxt.go/

Is there a particular reason you chose to suggest importing the package as "robotstxt.go" instead of "robotstxt-go"?

Ultimately, I would suggest getting rid of the dash (and any reference to "go") from the package name altogether to avoid issues like this. That appears to be the more idiomatic approach to naming packages.

temoto commented 8 years ago

Fixed by https://github.com/temoto/robotstxt/commit/99f6b48954d8cafb2f10790957aa747ca7aeb530

temoto commented 8 years ago

Oh and important note: this repository was renamed to just robotstxt. For all future readers: please use short import path without any "-go" or ".go".

sudotliu commented 8 years ago

Thanks for the quick response! 🍻