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. A local is a sentence only if every assignment to it is.
4
5func mixed(w int, err error, bad bool) {
6 msg := "the host is already held"
7 if bad {
8 msg = err.Error()
9 }
10 jsonError(w, 409, msg)
11}
12
13func fromMultiValue(w int, err error) {
14 text, _ := reasonOf(err)
15 jsonError(w, 400, text)
16}
17
18func reasonOf(err error) (string, bool) {
19 return err.Error(), true
20}
21
22func rangeVar(w int, names []string) {
23 for _, n := range names {
24 jsonError(w, 400, n)
25 }
26}
27