hackclub / hack-as-a-service-v0

⚠️ We've moved to @hack-as-a-service! ⚠️
https://haas.hackclub.com
20 stars 0 forks source link

Add golangci-lint #157

Closed gleich closed 3 years ago

gleich commented 3 years ago

golangci-lint is a CLI tool that takes a ton of golang linters and runs them all at once on your project. It is very popular in the go community and enforces some best practices when working with go. I believe that using tools such as golangci-lint and following go's best practices is crucial to the long-term health of haas. Things are simply now, let's not screw ourselves later down the road.

In order to work with this, we need to conform to the errcheck linter. The errcheck linter makes sure all functions that return an error get checked. As seen in the first commit I made there are a number of places where this needed to be added. A lot of these places were in goroutines that I am not 100% sure the context for. For those cases, I simply log the error to the console instead of causing a fatal log.

Signed-off-by: Matthew Gleich git@mattglei.ch

vercel[bot] commented 3 years ago

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployment, click below or on the icon next to each commit.

🔍 Inspect: https://vercel.com/hackclub/hack-as-a-service/ED9hmVXzbrmkwtSLs2hwvhB3mDRj
✅ Preview: https://hack-as-a-service-git-golangci-lint.hackclub.dev