MCPcopy Create free account
hub / github.com/devfeel/mapper / BenchmarkMapperSlice

Function BenchmarkMapperSlice

mapper_test.go:296–305  ·  view source on GitHub ↗
(b *testing.B)

Source from the content-addressed store, hash-verified

294}
295
296func BenchmarkMapperSlice(b *testing.B) {
297 var fromSlice []*FromStruct
298 var toSlice []*ToStruct
299 for i := 0; i < 10; i++ {
300 fromSlice = append(fromSlice, &FromStruct{Name: "From" + strconv.Itoa(i), Sex: true, AA: "AA" + strconv.Itoa(i)})
301 }
302 for i := 0; i < b.N; i++ {
303 MapperSlice(fromSlice, &toSlice)
304 }
305}
306
307func Test_AutoMapper(t *testing.T) {
308 from := &FromStruct{Name: "From", Sex: true, AA: "AA"}

Callers

nothing calls this directly

Calls 1

MapperSliceFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…