MCPcopy Index your code
hub / github.com/devfeel/mapper / Test_AutoMapper_StructToMap

Function Test_AutoMapper_StructToMap

mapper_test.go:318–331  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

316}
317
318func Test_AutoMapper_StructToMap(t *testing.T) {
319 from := &FromStruct{Name: "From", Sex: true, AA: "AA"}
320 to := make(map[string]interface{})
321 err := AutoMapper(from, &to)
322 if err != nil {
323 t.Error("RunResult error: mapper error", err)
324 } else {
325 if to["UserName"] == "From" {
326 t.Log("RunResult success:", to)
327 } else {
328 t.Error("RunResult failed: map[UserName]", to["UserName"])
329 }
330 }
331}
332
333func Test_MapperMap(t *testing.T) {
334 validateTime, _ := time.Parse("2006-01-02 15:04:05", "2017-01-01 10:00:00")

Callers

nothing calls this directly

Calls 1

AutoMapperFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…