From 5583fa2054a63f6a62f3ab715ffa766f20c25456 Mon Sep 17 00:00:00 2001 From: slene Date: Mon, 10 Mar 2014 20:52:04 +0800 Subject: [PATCH] orm add ResetModelCache api for test case --- orm/models.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/orm/models.go b/orm/models.go index 5744d865..59a8a8a1 100644 --- a/orm/models.go +++ b/orm/models.go @@ -98,3 +98,9 @@ func (mc *_modelCache) clean() { mc.cacheByFN = make(map[string]*modelInfo) mc.done = false } + +// Clean model cache. Then you can re-RegisterModel. +// Common use this api for test case. +func ResetModelCache() { + modelCache.clean() +}