carlos / platform Public

Clone
git clone https://amadan.net/carlos/platform

Plain git — no account needed to clone.

Download

Download this file

1package fixture
2
3// Not compiled. verifyArchive's shape: fail is a local closure configured as
4// a sink, so every call to it is checked. A call through an alias of it is
5// not, and passes an error's text.
6
7type Check struct{ Reason string }
8
9func verify(err error) Check {
10 var out Check
11 fail := func(reason string) Check {
12 out = Check{Reason: reason}
13 return out
14 }
15 if err == nil {
16 return fail("the archive is not readable")
17 }
18 send := fail
19 return send(err.Error())
20}
21