Setup populuates the struct with test data
()
| 46 | |
| 47 | // Setup populuates the struct with test data |
| 48 | func (e *Example) Setup() { |
| 49 | e.Interface = 10 |
| 50 | e.Any = "any" |
| 51 | e.Int64 = 10 |
| 52 | e.Uint64 = 11 |
| 53 | e.Int32 = 12 |
| 54 | e.Uint32 = 13 |
| 55 | e.Int16 = 14 |
| 56 | e.Uint16 = 15 |
| 57 | e.Int8 = 16 |
| 58 | e.Byte = 17 |
| 59 | e.Float64 = 18.1 |
| 60 | e.Float32 = 19.2 |
| 61 | e.String = "astr" |
| 62 | e.ByteSlice = []byte("bstr") |
| 63 | e.StringSlice = []string{"a", "b"} |
| 64 | e.IntArray = [...]int{20, 21} |
| 65 | e.SomeStruct = SomeStruct{A: "x"} |
| 66 | |
| 67 | e.EmbeddedStruct = EmbeddedStruct{A: "y"} |
| 68 | |
| 69 | e.Omitted = "nope" |
| 70 | |
| 71 | e.OmitEmptyString = "here" |
| 72 | } |
| 73 | |
| 74 | func (e *Example) Eq(e2 *Example) bool { |
| 75 | if int64(e.Interface.(int)) != e2.Interface.(int64) { |