Store information/reference about structure
问题 I am looking for a way to store information which struct a function should use. Each struct corresponds to certain database table. type Record struct { TableName string PrimaryKey string //XormStruct // how can I store User or Post here? XormStruct2 interface{} // see I have tried below XormStruct3 reflect.Type // see I have tried below } var posts []Post var ListOfTables [...]Record { {"User", "id", User}, //{"Post", "post_id", Post}, {"Post", "post_id", posts, reflect.TypeOf([]Post{})}, } /