All tags

How to mock OAuth 2.0 in Go

Jan 04, 2020
14 min read

We use OAuth 2.0 to access your information from GitHub. That way we don't have to store any sensitive data and you don't need an extra account. In production this works great. During development it makes our lives harder because GitHub needs access to our machines. We solve this problem by mocking all OAuth related networks requests to generate a fake token. This token won't give you access to the GitHub API so we also have to stub those requests.

Monitoring benchmarks over time in Go

Sep 10, 2019
3 min read

Having benchmarks for your critical code paths ensures stable performance and protection against accidental changes. However benchmarks are usually only done once and never run continuously. Learn how to keep an eye on your benchmarks over time.

How to measure code coverage in Go

Sep 06, 2019
4 min read

Code coverage is a first class citizen in Go. However programmatically getting the total code coverage for multiple packages within a single project can be tricky. Learn how to retrieve the overall code coverage by using standard Unix command line tools like grep and awk connected via pipes.