Source file
test/fixedbugs/issue63505.go
1
2
3
4
5
6
7 package main
8
9 type explainer struct {
10 m map[string]string
11 }
12
13 func init() {
14 RegisterExplainer(newExplainer())
15 }
16
17 type Explainer interface {
18 Name() string
19 Map() map[string]string
20 }
21
22 func (e explainer) Name() string {
23 return "HelloWorldExplainer"
24 }
25
26 func (e explainer) Map() map[string]string {
27 return e.m
28 }
29
30
31 func newExplainer() explainer {
32 m := make(map[string]string)
33 m["Hello"] = "World!"
34 return explainer{m}
35 }
36
37 var explainers = make(map[string]Explainer)
38
39 func RegisterExplainer(e Explainer) {
40 explainers[e.Name()] = e
41 }
42
43 func main() {
44
45 }
46
View as plain text