Subject: [bug#55903] [PATCH v2 02/35] gnu: Add go-github-com-creack-pty.

From: Maxime Devos <[email-masked]>
Date: Mon, 13 Jun 2022 09:43:05 +0200

( via Guix-patches via schreef op ma 13-06-2022 om 07:56 [+0100]:
> +(define (gnu-triplet->go-architecture target)
> +  (letrec-syntax
> +      ((matches (syntax-rules (=>)
> +                  ((_ (target-prefix => architecture) rest ...)
> +                   (if (string-prefix? target-prefix target)
> +                     architecture
> +                     (matches rest ...)))
> +                  ((_) (error "unsupported target" target)))))
> +    (matches ("x86_64"      => "amd64")
> +             ("i686"        => "386")
> +             ("aarch64"     => "arm64")
> +             ("arm"         => "arm")
> +             ("powerpc64le" => "ppc64le")
> +             ("powerpc"     => "ppc")
> +             ("mips64el"    => "mips64le")
> +             ("riscv64"     => "riscv64"))))

This looks like 'go-target' in (guix build-system go)?
(Haven't looked at the rest of the revised patches)

> +                       (with-output-to-file file
> +                         (lambda () (display text))))))))))

You can avoid global state here by using call-with-output-file.

Greetings,
Maxime.