diff mbox series

[bug#54560,05/47] gnu: Add go-github-com-asaskevich-govalidator.

Message ID 20220325133211.5128-5-hello@lnikki.la
State New
Headers show
Series [bug#54560,01/47] gnu: Add go-google-golang-org-protobuf. | expand

Commit Message

Leo Nikkilä March 25, 2022, 1:31 p.m. UTC
* gnu/packages/golang.scm (go-github-com-asaskevich-govalidator): New
variable.
---
 gnu/packages/golang.scm | 33 +++++++++++++++++++++++++++++++++
 1 file changed, 33 insertions(+)

Comments

M March 25, 2022, 7:26 p.m. UTC | #1
Leo Nikkilä schreef op vr 25-03-2022 om 15:31 [+0200]:
> +    (synopsis "Package of validators and sanitizers for strings,
> +numerics, slices and structs")
> +    (description "A package of validators and sanitizers for strings,
> +structs and collections.

Preferably, this description could be expanded a bit to make it more
useful.  ‘(guix)Synopses and Descriptions’ has some tips.

>   Based on validator.js.")

This does not seem relevant to the user?

Greetings,
Maxime.
diff mbox series

Patch

diff --git a/gnu/packages/golang.scm b/gnu/packages/golang.scm
index f8ca9cf580..ee22952fe7 100644
--- a/gnu/packages/golang.scm
+++ b/gnu/packages/golang.scm
@@ -9784,6 +9784,39 @@  (define-public go-github-com-go-chi-chi-v5
 decompose request handling into many smaller layers.")
     (license license:expat)))
 
+(define-public go-github-com-asaskevich-govalidator
+  (package
+    (name "go-github-com-asaskevich-govalidator")
+    (version "11.0.1")
+    (source (origin
+              (method git-fetch)
+              (uri (git-reference
+                    (url "https://github.com/asaskevich/govalidator")
+                    (commit (string-append "v" version))))
+              (file-name (git-file-name name version))
+              (sha256
+               (base32
+                "0aab1pym5c6di8vidynp6ly5j4kcqv6lp2737gw0a07zng0nn8lw"))))
+    (build-system go-build-system)
+    (arguments
+     '(#:import-path "github.com/asaskevich/govalidator"
+       #:phases
+       (modify-phases %standard-phases
+         (add-after 'unpack 'patch-tests
+           (lambda* (#:key import-path #:allow-other-keys)
+             ;; Skip test that needs network access to check MX records
+             (substitute* (string-append "src/" import-path
+                                         "/validator_test.go")
+               (("func TestIsExistingEmail\\(t \\*testing\\.T\\) \\{" match)
+                (string-append match "\n\tt.Skip()")))
+             #t)))))
+    (synopsis "Package of validators and sanitizers for strings,
+numerics, slices and structs")
+    (description "A package of validators and sanitizers for strings,
+structs and collections.  Based on validator.js.")
+    (home-page "https://github.com/asaskevich/govalidator")
+    (license license:expat)))
+
 (define-public go-google-golang-org-protobuf
   (package
     (name "go-google-golang-org-protobuf")