From 571033c038fb45ffeb8b951bf3b8ccc06046d8f3 Mon Sep 17 00:00:00 2001 From: Dinko Korunic Date: Wed, 24 Jul 2024 13:22:27 +0200 Subject: [PATCH] Backport doc changes from official fieldalignment --- betteralign.go | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/betteralign.go b/betteralign.go index 265108d..2a1e14d 100644 --- a/betteralign.go +++ b/betteralign.go @@ -74,6 +74,15 @@ Be aware that the most compact order is not always the most efficient. In rare cases it may cause two variables each updated by its own goroutine to occupy the same CPU cache line, inducing a form of memory contention known as "false sharing" that slows down both goroutines. + +Unlike most analyzers, which report likely mistakes, the diagnostics +produced by betteralign very rarely indicate a significant problem, +so the analyzer is not included in typical suites such as vet or +gopls. Use this standalone command to run it on your code: + + $ go install github.com/dkorunic/betteralign/cmd/betteralign@latest + $ betteralign [packages] + ` const ignoreStruct = "betteralign:ignore"