MCPcopy
hub / github.com/tinylib/msgp / Setup

Method Setup

tinygotest/testdata/roundtrip/main.go:48–72  ·  view source on GitHub ↗

Setup populuates the struct with test data

()

Source from the content-addressed store, hash-verified

46
47// Setup populuates the struct with test data
48func (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
74func (e *Example) Eq(e2 *Example) bool {
75 if int64(e.Interface.(int)) != e2.Interface.(int64) {

Callers 1

mainFunction · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected