bradfitz/goimports — pull request #24 by kisielk (2013-11-30 21:15:50+00:00)
Title: Use go/build to determine the package name.

This works correctly for packages with import paths ending in go-foo or foo.go but with an actual name of foo, or any other case where the package name does not match the import path.

In my usage I haven't found it to be perceivably slower than the naive path.Base method from before.