Subject: Re: [PATCH] gnu: Add go-github-com-dustin-gojson.

From: "Artyom V. Poptsov" <[email-masked]>
Date: Thu, 15 Feb 2024 23:52:14 +0300

Hello,

thank you for the patch review!

Here's the updated version of the patch.
From 185d399014fb2e9b4129f717fc3c56b181de243b Mon Sep 17 00:00:00 2001
Message-ID: <185d39[email-masked]>
From: "Artyom V. Poptsov" <[email-masked]>
Date: Wed, 14 Feb 2024 23:55:37 +0300
Subject: [PATCH] gnu: Add go-github-com-dustin-gojson.

* gnu/packages/golang.scm (go-github-com-dustin-gojson): New variable.

Change-Id: Ifc3df4e7a2cdf21bf0725a848123930d61d048e3
---
 gnu/packages/golang-xyz.scm | 35 +++++++++++++++++++++++++++++++++++
 1 file changed, 35 insertions(+)

diff --git a/gnu/packages/golang-xyz.scm b/gnu/packages/golang-xyz.scm
index 41821af92b..4546eb59c7 100644
--- a/gnu/packages/golang-xyz.scm
+++ b/gnu/packages/golang-xyz.scm
@@ -385,6 +385,41 @@ (define-public go-github-com-djherbis-atime
 atimes for files.")
     (license license:expat)))
 
+(define-public go-github-com-dustin-gojson
+  (package
+    (name "go-github-com-dustin-gojson")
+    (version "v0.0.0-20160307161227-2e71ec9dd5ad")
+    (source
+     (origin
+       (method git-fetch)
+       (uri (git-reference
+             (url "https://github.com/dustin/gojson")
+             (commit (go-version->git-ref version))))
+       (file-name (git-file-name name version))
+       (sha256
+        (base32 "1vrmmyn7l568l1k71mxd54iqf3d54pn86cf278i374j86jn0bdxf"))
+       (modules '((guix build utils)))
+       (snippet '(begin
+                   ;; Fix the library to work with go-1.21.
+                   (substitute* "decode.go"
+                     (("trying to unmarshal unquoted value into")
+                      "trying to unmarshal unquoted value %v into"))
+                   (substitute* "decode_test.go"
+                     (("t.Fatalf\\(\"Unmarshal: %v\"\\)")
+                      "t.Fatalf(\"Unmarshal: %v\", data)")) ;))))
+                   (substitute* "scanner.go"
+                     (("s := strconv.Quote\\(string\\(c\\)\\)")
+                      "s := strconv.QuoteRune(rune(c))"))))))
+    (build-system go-build-system)
+    (arguments
+     `(#:import-path "github.com/dustin/gojson"
+       #:go ,go-1.21))
+    (home-page "https://github.com/dustin/gojson")
+    (synopsis "Fork of go's encoding/json with the public scanner API")
+    (description
+     "Fork of go's encoding/json with the scanner API made public.")
+    (license license:bsd-3)))
+
 (define-public go-github-com-gabriel-vasile-mimetype
   (package
     (name "go-github-com-gabriel-vasile-mimetype")

base-commit: 203344cc37c8a7df1ec1454381b5069d53ce7f9e
-- 
2.41.0

- avp

-- 
Artyom "avp" Poptsov <[email-masked]>
Home page: https://memory-heap.org/~avp/
CADR Hackerspace co-founder: https://cadrspace.ru/
GPG: D0C2 EAC1 3310 822D 98DE  B57C E9C5 A2D9 0898 A02F