Subject: [PATCH v2 5/7] gnu: Add go-structlayout-optimize.

From: Nicolas Graves <[email-masked]>
Date: Sat, 27 Jan 2024 19:21:30 +0100

* gnu/packages/golang-check.scm (go-structlayout-optimize): New variable.

Change-Id: I7e1ce9acbe3ec09cc8b441de4816b247a2742938
---
 gnu/packages/golang-check.scm | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/gnu/packages/golang-check.scm b/gnu/packages/golang-check.scm
index 13f38dc249..2621d6b95b 100644
--- a/gnu/packages/golang-check.scm
+++ b/gnu/packages/golang-check.scm
@@ -123,6 +123,19 @@ (define-public go-structlayout
 is printed in human-readable form by default, or as JSON with the @code{-json}
 flag.")))
 
+(define-public go-structlayout-optimize
+  (package
+    (inherit go-honnef-co-go-tools)
+    (name "go-structlayout-optimize")
+    (arguments
+     `(#:import-path "honnef.co/go/tools/cmd/structlayout-optimize"
+       #:unpack-path "honnef.co/go/tools"
+       #:install-source? #f))
+    (synopsis "Reorder struct fields to minimize the amount of padding in Go.")
+    (description "This package reads @code{go-structlayout} JSON on stdin and
+reorders fields to minimize the amount of padding.  It can emit JSON to feed
+into @code{go-structlayout-pretty}.")))
+
 (define-public go-github-com-alecthomas-assert
   (let ((commit "405dbfeb8e38effee6e723317226e93fff912d06")
         (revision "1"))
-- 
2.41.0