add Get
method to model registry
This commit is contained in:
parent
15d032459a
commit
53e23bb52a
@ -234,6 +234,14 @@ func (r TModelRegistry) new_(n string) interface{} {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (r TModelRegistry) Get(name string) *Model {
|
||||||
|
model, ok := r[name]
|
||||||
|
if !ok {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
return model
|
||||||
|
}
|
||||||
|
|
||||||
// Model registers models in the ModelRegistry, where
|
// Model registers models in the ModelRegistry, where
|
||||||
// they can be accessed via a model's struct name
|
// they can be accessed via a model's struct name
|
||||||
func (r TModelRegistry) Model(mdl ...any) {
|
func (r TModelRegistry) Model(mdl ...any) {
|
||||||
|
Loading…
Reference in New Issue
Block a user