merge_gen.go 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209
  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. // Code generated by generate-types. DO NOT EDIT.
  5. package impl
  6. import ()
  7. func mergeBool(dst, src pointer, _ *coderFieldInfo, _ mergeOptions) {
  8. *dst.Bool() = *src.Bool()
  9. }
  10. func mergeBoolNoZero(dst, src pointer, _ *coderFieldInfo, _ mergeOptions) {
  11. v := *src.Bool()
  12. if v != false {
  13. *dst.Bool() = v
  14. }
  15. }
  16. func mergeBoolPtr(dst, src pointer, _ *coderFieldInfo, _ mergeOptions) {
  17. p := *src.BoolPtr()
  18. if p != nil {
  19. v := *p
  20. *dst.BoolPtr() = &v
  21. }
  22. }
  23. func mergeBoolSlice(dst, src pointer, _ *coderFieldInfo, _ mergeOptions) {
  24. ds := dst.BoolSlice()
  25. ss := src.BoolSlice()
  26. *ds = append(*ds, *ss...)
  27. }
  28. func mergeInt32(dst, src pointer, _ *coderFieldInfo, _ mergeOptions) {
  29. *dst.Int32() = *src.Int32()
  30. }
  31. func mergeInt32NoZero(dst, src pointer, _ *coderFieldInfo, _ mergeOptions) {
  32. v := *src.Int32()
  33. if v != 0 {
  34. *dst.Int32() = v
  35. }
  36. }
  37. func mergeInt32Ptr(dst, src pointer, _ *coderFieldInfo, _ mergeOptions) {
  38. p := *src.Int32Ptr()
  39. if p != nil {
  40. v := *p
  41. *dst.Int32Ptr() = &v
  42. }
  43. }
  44. func mergeInt32Slice(dst, src pointer, _ *coderFieldInfo, _ mergeOptions) {
  45. ds := dst.Int32Slice()
  46. ss := src.Int32Slice()
  47. *ds = append(*ds, *ss...)
  48. }
  49. func mergeUint32(dst, src pointer, _ *coderFieldInfo, _ mergeOptions) {
  50. *dst.Uint32() = *src.Uint32()
  51. }
  52. func mergeUint32NoZero(dst, src pointer, _ *coderFieldInfo, _ mergeOptions) {
  53. v := *src.Uint32()
  54. if v != 0 {
  55. *dst.Uint32() = v
  56. }
  57. }
  58. func mergeUint32Ptr(dst, src pointer, _ *coderFieldInfo, _ mergeOptions) {
  59. p := *src.Uint32Ptr()
  60. if p != nil {
  61. v := *p
  62. *dst.Uint32Ptr() = &v
  63. }
  64. }
  65. func mergeUint32Slice(dst, src pointer, _ *coderFieldInfo, _ mergeOptions) {
  66. ds := dst.Uint32Slice()
  67. ss := src.Uint32Slice()
  68. *ds = append(*ds, *ss...)
  69. }
  70. func mergeInt64(dst, src pointer, _ *coderFieldInfo, _ mergeOptions) {
  71. *dst.Int64() = *src.Int64()
  72. }
  73. func mergeInt64NoZero(dst, src pointer, _ *coderFieldInfo, _ mergeOptions) {
  74. v := *src.Int64()
  75. if v != 0 {
  76. *dst.Int64() = v
  77. }
  78. }
  79. func mergeInt64Ptr(dst, src pointer, _ *coderFieldInfo, _ mergeOptions) {
  80. p := *src.Int64Ptr()
  81. if p != nil {
  82. v := *p
  83. *dst.Int64Ptr() = &v
  84. }
  85. }
  86. func mergeInt64Slice(dst, src pointer, _ *coderFieldInfo, _ mergeOptions) {
  87. ds := dst.Int64Slice()
  88. ss := src.Int64Slice()
  89. *ds = append(*ds, *ss...)
  90. }
  91. func mergeUint64(dst, src pointer, _ *coderFieldInfo, _ mergeOptions) {
  92. *dst.Uint64() = *src.Uint64()
  93. }
  94. func mergeUint64NoZero(dst, src pointer, _ *coderFieldInfo, _ mergeOptions) {
  95. v := *src.Uint64()
  96. if v != 0 {
  97. *dst.Uint64() = v
  98. }
  99. }
  100. func mergeUint64Ptr(dst, src pointer, _ *coderFieldInfo, _ mergeOptions) {
  101. p := *src.Uint64Ptr()
  102. if p != nil {
  103. v := *p
  104. *dst.Uint64Ptr() = &v
  105. }
  106. }
  107. func mergeUint64Slice(dst, src pointer, _ *coderFieldInfo, _ mergeOptions) {
  108. ds := dst.Uint64Slice()
  109. ss := src.Uint64Slice()
  110. *ds = append(*ds, *ss...)
  111. }
  112. func mergeFloat32(dst, src pointer, _ *coderFieldInfo, _ mergeOptions) {
  113. *dst.Float32() = *src.Float32()
  114. }
  115. func mergeFloat32NoZero(dst, src pointer, _ *coderFieldInfo, _ mergeOptions) {
  116. v := *src.Float32()
  117. if v != 0 {
  118. *dst.Float32() = v
  119. }
  120. }
  121. func mergeFloat32Ptr(dst, src pointer, _ *coderFieldInfo, _ mergeOptions) {
  122. p := *src.Float32Ptr()
  123. if p != nil {
  124. v := *p
  125. *dst.Float32Ptr() = &v
  126. }
  127. }
  128. func mergeFloat32Slice(dst, src pointer, _ *coderFieldInfo, _ mergeOptions) {
  129. ds := dst.Float32Slice()
  130. ss := src.Float32Slice()
  131. *ds = append(*ds, *ss...)
  132. }
  133. func mergeFloat64(dst, src pointer, _ *coderFieldInfo, _ mergeOptions) {
  134. *dst.Float64() = *src.Float64()
  135. }
  136. func mergeFloat64NoZero(dst, src pointer, _ *coderFieldInfo, _ mergeOptions) {
  137. v := *src.Float64()
  138. if v != 0 {
  139. *dst.Float64() = v
  140. }
  141. }
  142. func mergeFloat64Ptr(dst, src pointer, _ *coderFieldInfo, _ mergeOptions) {
  143. p := *src.Float64Ptr()
  144. if p != nil {
  145. v := *p
  146. *dst.Float64Ptr() = &v
  147. }
  148. }
  149. func mergeFloat64Slice(dst, src pointer, _ *coderFieldInfo, _ mergeOptions) {
  150. ds := dst.Float64Slice()
  151. ss := src.Float64Slice()
  152. *ds = append(*ds, *ss...)
  153. }
  154. func mergeString(dst, src pointer, _ *coderFieldInfo, _ mergeOptions) {
  155. *dst.String() = *src.String()
  156. }
  157. func mergeStringNoZero(dst, src pointer, _ *coderFieldInfo, _ mergeOptions) {
  158. v := *src.String()
  159. if v != "" {
  160. *dst.String() = v
  161. }
  162. }
  163. func mergeStringPtr(dst, src pointer, _ *coderFieldInfo, _ mergeOptions) {
  164. p := *src.StringPtr()
  165. if p != nil {
  166. v := *p
  167. *dst.StringPtr() = &v
  168. }
  169. }
  170. func mergeStringSlice(dst, src pointer, _ *coderFieldInfo, _ mergeOptions) {
  171. ds := dst.StringSlice()
  172. ss := src.StringSlice()
  173. *ds = append(*ds, *ss...)
  174. }