Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Putting tests next to what will be tested #15

Open
SunkPlane29 opened this issue Oct 1, 2020 · 0 comments
Open

Putting tests next to what will be tested #15

SunkPlane29 opened this issue Oct 1, 2020 · 0 comments

Comments

@SunkPlane29
Copy link

SunkPlane29 commented Oct 1, 2020

Currently, the tests written for this project are in a separate tests folder. It's best practice in Go putting each test inside the package that defines what is to be tested. For example:

service/
    youtube.go
    youtube_test.go
    extract_links.go
    extract_links_test.go

Note that there are some cases where tests can be put in a separate folder, but it's pretty uncommon.

We can use some open source projects for guidance:
https://github.com/kubernetes/kubernetes/tree/master/pkg/controlplane
https://github.com/tsuru/tsuru/tree/master/api
https://github.com/cockroachdb/cockroach/tree/master/pkg/base
https://github.com/golang/go/tree/master/src/bytes (Go's standard bytes package)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant