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. The inner m shadows the parameter m, whose type has a method
4// that returns a recorded sentence. The inner m's type is another package's,
5// and its Message may return anything.
6
7type local struct{}
8
9func (local) Message() string {
10 return "a recorded sentence"
11}
12
13func viaShadow(w int, m local, supplied external) {
14 if m := supplied; m != nil {
15 jsonError(w, 400, m.Message())
16 }
17}
18
19func direct(w int, m local) {
20 jsonError(w, 400, m.Message())
21}
22