decred / dcrdevdocs

Decred Development Documentation
https://devdocs.decred.org
ISC License
5 stars 11 forks source link

Golang Unit Testing: Brief Guide and Best Practices #103

Open matthawkins90 opened 2 years ago

matthawkins90 commented 2 years ago

I'm trying to teach myself Go.

Unit tests are highly valued for these projects. Unit tests are also a great way for new contributors to get familiar with a project, and can also serve as a form of documentation for how code works.

I think it would be a good idea to have a basic guide and "best practices" in the Contributing section of the dev docs, just to start collecting that knowledge there.

I'm thinking about having sections like:

I'm definitely not an expert on any of these topics, but I want to start aggregating information into a guide. I would welcome any tips or examples to follow from more experienced devs here!