From f728a31c50c34a13efdfc4dec1a928efbbd35e39 Mon Sep 17 00:00:00 2001 Message-ID: In-Reply-To: References: From: "Artyom V. Poptsov" Date: Sat, 2 Mar 2024 23:26:40 +0300 Subject: [PATCH 2/2] gnu: Add go-github-com-hashicorp-go-multierror. * gnu/packages/golang-xyz.scm (go-github-com-hashicorp-go-multierror): New variable. Change-Id: I6b09a52dc314c4cc6903690738debf4b6c99393f --- gnu/packages/golang-xyz.scm | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/gnu/packages/golang-xyz.scm b/gnu/packages/golang-xyz.scm index b52753c9bb..3dcfd690a3 100644 --- a/gnu/packages/golang-xyz.scm +++ b/gnu/packages/golang-xyz.scm @@ -724,6 +724,39 @@ (define-public go-github-com-hashicorp-errwrap is wrapped, and extracting that error.") (license license:mpl2.0))) +(define-public go-github-com-hashicorp-go-multierror + (package + (name "go-github-com-hashicorp-go-multierror") + (version "1.1.1") + (source + (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/hashicorp/go-multierror") + (commit (string-append "v" version)))) + (file-name (git-file-name name version)) + (sha256 + (base32 "0l4s41skdpifndn9s8y6s9vzgghdzg4z8z0lld9qjr28888wzp00")))) + (build-system go-build-system) + (inputs (list go-github-com-hashicorp-errwrap)) + (arguments + (list + #:import-path "github.com/hashicorp/go-multierror")) + (home-page "https://github.com/hashicorp/go-multierror") + (synopsis "Go package for representing a errors list as a single error") + (description + "@code{go-multierror} is a package for Go that provides a mechanism for +representing a list of @code{error} values as a single @code{error}. + +This allows a function in Go to return an @code{error} that might actually be a list +of errors. If the caller knows this, they can unwrap the list and access the errors. +If the caller doesn't know, the error formats to a nice human-readable format. + +@code{go-multierror} is fully compatible with the Go standard library @code{errors} +package, including the functions @code{As}, @code{Is}, and @code{Unwrap}. This +provides a standardized approach for introspecting on error values.") + (license license:mpl2.0))) + (define-public go-github-com-jinzhu-copier (package (name "go-github-com-jinzhu-copier") -- 2.41.0