Benchmark_MapSlice_Old 基准测试: 原有 MapperSlice 方法
(b *testing.B)
| 282 | |
| 283 | // Benchmark_MapSlice_Old 基准测试: 原有 MapperSlice 方法 |
| 284 | func Benchmark_MapSlice_Old(b *testing.B) { |
| 285 | users := make([]BMUser, 100) |
| 286 | for i := 0; i < 100; i++ { |
| 287 | users[i] = BMUser{ |
| 288 | ID: int64(i), |
| 289 | Name: "User", |
| 290 | Email: "test@example.com", |
| 291 | Age: 25, |
| 292 | CreatedAt: 1704067200, |
| 293 | Status: 1, |
| 294 | Score: 95.5, |
| 295 | } |
| 296 | } |
| 297 | userDTOs := &[]BMUserDTO{} |
| 298 | |
| 299 | b.ResetTimer() |
| 300 | for i := 0; i < b.N; i++ { |
| 301 | _ = MapperSlice(users, userDTOs) |
| 302 | } |
| 303 | } |
nothing calls this directly
no test coverage detected
searching dependent graphs…