...
1 package option
2
3 import "fmt"
4
5
6 type Interface interface {
7
8
9 Ident() interface{}
10
11
12 Value() interface{}
13 }
14
15 type pair struct {
16 ident interface{}
17 value interface{}
18 }
19
20
21 func New(ident, value interface{}) Interface {
22 return &pair{
23 ident: ident,
24 value: value,
25 }
26 }
27
28 func (p *pair) Ident() interface{} {
29 return p.ident
30 }
31
32 func (p *pair) Value() interface{} {
33 return p.value
34 }
35
36 func (p *pair) String() string {
37 return fmt.Sprintf(`%v(%v)`, p.ident, p.value)
38 }
39
View as plain text