Subject: [PATCH 05/47] gnu: Add go-github-com-asaskevich-govalidator.

From: Leo Nikkilä <[email-masked]>
Date: Fri, 25 Mar 2022 15:31:29 +0200

* gnu/packages/golang.scm (go-github-com-asaskevich-govalidator): New
variable.
---
 gnu/packages/golang.scm | 33 +++++++++++++++++++++++++++++++++
 1 file changed, 33 insertions(+)

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")
-- 
2.34.0