-
Notifications
You must be signed in to change notification settings - Fork 3
/
wrapper.go
50 lines (38 loc) · 991 Bytes
/
wrapper.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
// generated by yagi. Don't modify this file!
// Any changes will be lost if this file is regenerated.
package wrapper
import "github.com/hneemann/yagi/example/wrapper/largecode"
type WrapperInt64 struct{ delegate largecode.List }
func (l *WrapperInt64) Add(item int64) {
l.delegate.Add(item)
}
func (l *WrapperInt64) Get(index int) int64 {
item, ok := l.delegate.Get(index).(int64)
if ok {
return item
}
panic("wrong type in list")
}
func (l *WrapperInt64) Remove(index int) {
l.delegate.Remove(index)
}
func (l *WrapperInt64) Len() int {
return l.delegate.Len()
}
type WrapperString struct{ delegate largecode.List }
func (l *WrapperString) Add(item string) {
l.delegate.Add(item)
}
func (l *WrapperString) Get(index int) string {
item, ok := l.delegate.Get(index).(string)
if ok {
return item
}
panic("wrong type in list")
}
func (l *WrapperString) Remove(index int) {
l.delegate.Remove(index)
}
func (l *WrapperString) Len() int {
return l.delegate.Len()
}