On Sat, Apr 28, 2012 at 8:04 AM, Francisco Souza <
f...@souza.cc> wrote:
> The standard library has cases of both approaches [1] [2], the documentation
> [3] shows only a very simple example using the package name.
Others have given good reasons for the choice in general; the standard
Go style is to put tests in the same package as the code under test.
In the specific case of the standard library, the exceptions (e.g.
sort_test.go) are to avoid a circular dependency. The "testing"
package depends on a bunch of packages itself, and those packages may
not depend on "testing", so therefore the tests for those packages may
not be in the same package.
Dave.