MCPcopy Index your code
hub / github.com/go-gorp/gorp / ColMap

Method ColMap

table.go:102–111  ·  view source on GitHub ↗

ColMap returns the ColumnMap pointer matching the given struct field name. It panics if the struct does not contain a field matching this name.

(field string)

Source from the content-addressed store, hash-verified

100// name. It panics if the struct does not contain a field matching this
101// name.
102func (t *TableMap) ColMap(field string) *ColumnMap {
103 col := colMapOrNil(t, field)
104 if col == nil {
105 e := fmt.Sprintf("No ColumnMap in table %s type %s with field %s",
106 t.TableName, t.gotype.Name(), field)
107
108 panic(e)
109 }
110 return col
111}
112
113func colMapOrNil(t *TableMap, field string) *ColumnMap {
114 for _, col := range t.Columns {

Callers 9

SetKeysMethod · 0.95
AddIndexMethod · 0.95
SetVersionColMethod · 0.95
insertFunction · 0.80
TestPersistentUserFunction · 0.80
TestNamedQueryMapFunction · 0.80
TestNamedQueryStructFunction · 0.80
TestColumnPropsFunction · 0.80
columnNameFunction · 0.80

Calls 1

colMapOrNilFunction · 0.85

Tested by 5

TestPersistentUserFunction · 0.64
TestNamedQueryMapFunction · 0.64
TestNamedQueryStructFunction · 0.64
TestColumnPropsFunction · 0.64
columnNameFunction · 0.64