summary refs log tree commit diff
path: root/gnu/packages
diff options
context:
space:
mode:
author(unmatched-parenthesis <paren@disroot.org>2022-10-21 22:11:21 +0100
committerRaghav Gururajan <rg@raghavgururajan.name>2022-11-27 10:31:34 -0500
commit5e2c3f90357cbed689b37bfd3d356594a4c562c7 (patch)
tree126580c99959cddc78cd811a1851ab7e9a5c2573 /gnu/packages
parent26e57c23187416bfb285c49687a968fdcdd9c586 (diff)
downloadguix-5e2c3f90357cbed689b37bfd3d356594a4c562c7.tar.gz
gnu: Add go-github-com-niemeyer-pretty.
* gnu/packages/golang.scm (go-github-com-niemeyer-pretty): New variable.

Signed-off-by: Raghav Gururajan <rg@raghavgururajan.name>
Diffstat (limited to 'gnu/packages')
-rw-r--r--gnu/packages/golang.scm33
1 files changed, 33 insertions, 0 deletions
diff --git a/gnu/packages/golang.scm b/gnu/packages/golang.scm
index 0e3a5d6d19..3dc9ecf67e 100644
--- a/gnu/packages/golang.scm
+++ b/gnu/packages/golang.scm
@@ -11052,6 +11052,39 @@ reflect.DeepEqual but returns a list of differences.  This is helpful
 when comparing complex types like structures and maps.")
     (license license:expat)))
 
+(define-public go-github-com-niemeyer-pretty
+  (package
+    (name "go-github-com-niemeyer-pretty")
+    (version "0.0.0-20200227124842-a10e7caefd8e")
+    (source (origin
+              (method git-fetch)
+              (uri (git-reference
+                    (url "https://github.com/niemeyer/pretty")
+                    (commit (go-version->git-ref version))))
+              (file-name (git-file-name name version))
+              (sha256
+               (base32
+                "1jmazh4xzaa3v6g46hz60q2z7nmqs9l9cxdzmmscn3kbcs2znq4v"))))
+    (build-system go-build-system)
+    (arguments
+     (list #:import-path "github.com/niemeyer/pretty"
+           #:phases
+           #~(modify-phases %standard-phases
+               (add-after 'unpack 'int-to-string-with-rune
+                 (lambda* (#:key import-path #:allow-other-keys)
+                   (with-directory-excursion (string-append "src/" import-path)
+                     (substitute* "formatter.go"
+                       (("s \\+= string\\(i\\)")
+                        "s += string(rune(i))"))))))))
+    (propagated-inputs (list go-github-com-kr-text))
+    (home-page "https://github.com/niemeyer/pretty")
+    (synopsis "Pretty-print Go values")
+    (description
+     "The pretty package provides pretty-printing for Go values.  This is
+useful during debugging, to avoid wrapping long output lines in the
+terminal.")
+    (license license:expat)))
+
 ;;;
 ;;; Avoid adding new packages to the end of this file. To reduce the chances
 ;;; of a merge conflict, place them above by existing packages with similar