gorm/schema
Andy Bursavich 61d3a4d6ea
Fix schema initialization paths (#3825)
* Fix schema initialization paths

The initialized channel was only closed if the schema's cacheStore did not contain the embeddedCacheKey and there were no errors parsing relations.  If the key existed or an error occurred, it would not be closed. This could leave other goroutines waiting for synchronization that will never occur.

Additionally, the other code paths that wait for initialization to complete did not return the possible error.

* Unnest common schema initialization

This makes the common code path less deeply nested and the flow control easier to follow.
2020-12-04 11:28:38 +08:00
..
callbacks_test.go Rename package name 2020-06-02 09:18:01 +08:00
check.go Add Raw, Row, Rows 2020-02-22 19:41:01 +08:00
check_test.go Rename package name 2020-06-02 09:18:01 +08:00
field.go Fix failed to parse relations when using goroutinue, close #3790 2020-11-27 14:32:20 +08:00
field_test.go Fix set bool field from null 2020-07-04 08:21:23 +08:00
index.go Add option tag support for index 2020-10-21 20:18:21 +08:00
index_test.go Add option tag support for index 2020-10-21 20:18:21 +08:00
interfaces.go Add GormValuer interface support 2020-08-27 15:03:57 +08:00
model_test.go Fix nested embedded struct, close #3278 2020-08-18 11:21:40 +08:00
naming.go Support NameReplace for NamingStrategy, close #3779 2020-11-23 11:24:07 +08:00
naming_test.go Support NameReplace for NamingStrategy, close #3779 2020-11-23 11:24:07 +08:00
relationship.go Fix failed to parse relations when using goroutinue, close #3790 2020-11-27 14:32:20 +08:00
relationship_test.go Build relationships if fields are not ignored, fix #3181 2020-09-09 16:37:05 +08:00
schema.go Fix schema initialization paths (#3825) 2020-12-04 11:28:38 +08:00
schema_helper_test.go Test same field name from embedded field, close #3291 2020-08-20 10:58:35 +08:00
schema_test.go Fix NamingStrategy with embedded struct, close #3513 2020-09-24 11:32:38 +08:00
utils.go Reduce GC alloc 2020-11-10 21:23:20 +08:00
utils_test.go Remove autoincrement tag for join table, close #3217 2020-07-31 18:19:25 +08:00