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 interface's implementation may live in another package and
4// say anything. A method selected only by its name is no better.
5
6type messenger interface {
7 Message() string
8}
9
10type local struct{}
11
12func (local) Message() string {
13 return "a recorded sentence"
14}
15
16func viaInterface(w int, m messenger) {
17 jsonError(w, 400, m.Message())
18}
19
20func viaUnknown(w int, x external) {
21 jsonError(w, 400, x.Message())
22}
23