Our great sponsors
-
bodyclose
Analyzer: checks whether HTTP response body is closed and a re-use of TCP connection is not blocked.
I know this is a set of examples for synchronization not for HTTP, but examples like this being published and copy-pasted everywhere are why most HTTP clients in Go are incorrect. There's even a bodyclose lint to catch the mistake made here, but most people don't seem to know about it, and it's even disabled by default in golangci-lint.
-
Proposals like this for improving alignment do end up adding type level tags... but as comments. I'm really having trouble understanding how the language team hasn't come around about using comments for this yet. At first it was an argument that it doesn't actually affect the language's semantic complexity, but now that it affects the correctness of code for things like atomics and FFI, it should be counted as part of the language and be on equal footing for analysis by all tools. I'm not the first to say so.
-
SonarLint
Clean code begins in your IDE with SonarLint. Up your coding game and discover issues early. SonarLint is a free plugin that helps you find & fix bugs and security issues from the moment you start writing code. Install from your favorite IDE marketplace today.