MCPcopy
hub / github.com/astaxie/build-web-application-with-golang / insertUsingMap

Function insertUsingMap

en/code/src/apps/ch.5.5/main.go:42–52  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

40 return int64(obj.Uid)
41}
42func insertUsingMap() int64 {
43 fmt.Println("insertUsingMap()")
44 add := make(map[string]interface{})
45 add["username"] = "astaxie"
46 add["department"] = "cloud develop"
47 add["created"] = getTimeStamp()
48 id, err := orm.SetTable("userinfo").Insert(add)
49 checkError(err)
50 fmt.Println("Last row inserted id =", id)
51 return id
52}
53
54func getOneUserInfo(id int64) Userinfo {
55 fmt.Println("getOneUserInfo()")

Callers 1

mainFunction · 0.70

Calls 2

getTimeStampFunction · 0.70
checkErrorFunction · 0.70

Tested by

no test coverage detected