merge_gen.go (4640B)
1 // Copyright 2018 The Go Authors. All rights reserved. 2 // Use of this source code is governed by a BSD-style 3 // license that can be found in the LICENSE file. 4 5 // Code generated by generate-types. DO NOT EDIT. 6 7 package impl 8 9 import () 10 11 func mergeBool(dst, src pointer, _ *coderFieldInfo, _ mergeOptions) { 12 *dst.Bool() = *src.Bool() 13 } 14 15 func mergeBoolNoZero(dst, src pointer, _ *coderFieldInfo, _ mergeOptions) { 16 v := *src.Bool() 17 if v != false { 18 *dst.Bool() = v 19 } 20 } 21 22 func mergeBoolPtr(dst, src pointer, _ *coderFieldInfo, _ mergeOptions) { 23 p := *src.BoolPtr() 24 if p != nil { 25 v := *p 26 *dst.BoolPtr() = &v 27 } 28 } 29 30 func mergeBoolSlice(dst, src pointer, _ *coderFieldInfo, _ mergeOptions) { 31 ds := dst.BoolSlice() 32 ss := src.BoolSlice() 33 *ds = append(*ds, *ss...) 34 } 35 36 func mergeInt32(dst, src pointer, _ *coderFieldInfo, _ mergeOptions) { 37 *dst.Int32() = *src.Int32() 38 } 39 40 func mergeInt32NoZero(dst, src pointer, _ *coderFieldInfo, _ mergeOptions) { 41 v := *src.Int32() 42 if v != 0 { 43 *dst.Int32() = v 44 } 45 } 46 47 func mergeInt32Ptr(dst, src pointer, _ *coderFieldInfo, _ mergeOptions) { 48 p := *src.Int32Ptr() 49 if p != nil { 50 v := *p 51 *dst.Int32Ptr() = &v 52 } 53 } 54 55 func mergeInt32Slice(dst, src pointer, _ *coderFieldInfo, _ mergeOptions) { 56 ds := dst.Int32Slice() 57 ss := src.Int32Slice() 58 *ds = append(*ds, *ss...) 59 } 60 61 func mergeUint32(dst, src pointer, _ *coderFieldInfo, _ mergeOptions) { 62 *dst.Uint32() = *src.Uint32() 63 } 64 65 func mergeUint32NoZero(dst, src pointer, _ *coderFieldInfo, _ mergeOptions) { 66 v := *src.Uint32() 67 if v != 0 { 68 *dst.Uint32() = v 69 } 70 } 71 72 func mergeUint32Ptr(dst, src pointer, _ *coderFieldInfo, _ mergeOptions) { 73 p := *src.Uint32Ptr() 74 if p != nil { 75 v := *p 76 *dst.Uint32Ptr() = &v 77 } 78 } 79 80 func mergeUint32Slice(dst, src pointer, _ *coderFieldInfo, _ mergeOptions) { 81 ds := dst.Uint32Slice() 82 ss := src.Uint32Slice() 83 *ds = append(*ds, *ss...) 84 } 85 86 func mergeInt64(dst, src pointer, _ *coderFieldInfo, _ mergeOptions) { 87 *dst.Int64() = *src.Int64() 88 } 89 90 func mergeInt64NoZero(dst, src pointer, _ *coderFieldInfo, _ mergeOptions) { 91 v := *src.Int64() 92 if v != 0 { 93 *dst.Int64() = v 94 } 95 } 96 97 func mergeInt64Ptr(dst, src pointer, _ *coderFieldInfo, _ mergeOptions) { 98 p := *src.Int64Ptr() 99 if p != nil { 100 v := *p 101 *dst.Int64Ptr() = &v 102 } 103 } 104 105 func mergeInt64Slice(dst, src pointer, _ *coderFieldInfo, _ mergeOptions) { 106 ds := dst.Int64Slice() 107 ss := src.Int64Slice() 108 *ds = append(*ds, *ss...) 109 } 110 111 func mergeUint64(dst, src pointer, _ *coderFieldInfo, _ mergeOptions) { 112 *dst.Uint64() = *src.Uint64() 113 } 114 115 func mergeUint64NoZero(dst, src pointer, _ *coderFieldInfo, _ mergeOptions) { 116 v := *src.Uint64() 117 if v != 0 { 118 *dst.Uint64() = v 119 } 120 } 121 122 func mergeUint64Ptr(dst, src pointer, _ *coderFieldInfo, _ mergeOptions) { 123 p := *src.Uint64Ptr() 124 if p != nil { 125 v := *p 126 *dst.Uint64Ptr() = &v 127 } 128 } 129 130 func mergeUint64Slice(dst, src pointer, _ *coderFieldInfo, _ mergeOptions) { 131 ds := dst.Uint64Slice() 132 ss := src.Uint64Slice() 133 *ds = append(*ds, *ss...) 134 } 135 136 func mergeFloat32(dst, src pointer, _ *coderFieldInfo, _ mergeOptions) { 137 *dst.Float32() = *src.Float32() 138 } 139 140 func mergeFloat32NoZero(dst, src pointer, _ *coderFieldInfo, _ mergeOptions) { 141 v := *src.Float32() 142 if v != 0 { 143 *dst.Float32() = v 144 } 145 } 146 147 func mergeFloat32Ptr(dst, src pointer, _ *coderFieldInfo, _ mergeOptions) { 148 p := *src.Float32Ptr() 149 if p != nil { 150 v := *p 151 *dst.Float32Ptr() = &v 152 } 153 } 154 155 func mergeFloat32Slice(dst, src pointer, _ *coderFieldInfo, _ mergeOptions) { 156 ds := dst.Float32Slice() 157 ss := src.Float32Slice() 158 *ds = append(*ds, *ss...) 159 } 160 161 func mergeFloat64(dst, src pointer, _ *coderFieldInfo, _ mergeOptions) { 162 *dst.Float64() = *src.Float64() 163 } 164 165 func mergeFloat64NoZero(dst, src pointer, _ *coderFieldInfo, _ mergeOptions) { 166 v := *src.Float64() 167 if v != 0 { 168 *dst.Float64() = v 169 } 170 } 171 172 func mergeFloat64Ptr(dst, src pointer, _ *coderFieldInfo, _ mergeOptions) { 173 p := *src.Float64Ptr() 174 if p != nil { 175 v := *p 176 *dst.Float64Ptr() = &v 177 } 178 } 179 180 func mergeFloat64Slice(dst, src pointer, _ *coderFieldInfo, _ mergeOptions) { 181 ds := dst.Float64Slice() 182 ss := src.Float64Slice() 183 *ds = append(*ds, *ss...) 184 } 185 186 func mergeString(dst, src pointer, _ *coderFieldInfo, _ mergeOptions) { 187 *dst.String() = *src.String() 188 } 189 190 func mergeStringNoZero(dst, src pointer, _ *coderFieldInfo, _ mergeOptions) { 191 v := *src.String() 192 if v != "" { 193 *dst.String() = v 194 } 195 } 196 197 func mergeStringPtr(dst, src pointer, _ *coderFieldInfo, _ mergeOptions) { 198 p := *src.StringPtr() 199 if p != nil { 200 v := *p 201 *dst.StringPtr() = &v 202 } 203 } 204 205 func mergeStringSlice(dst, src pointer, _ *coderFieldInfo, _ mergeOptions) { 206 ds := dst.StringSlice() 207 ss := src.StringSlice() 208 *ds = append(*ds, *ss...) 209 }