MCPcopy
hub / github.com/go-gorm/gorm / Use

Method Use

gorm.go:534–544  ·  view source on GitHub ↗

Use use plugin

(plugin Plugin)

Source from the content-addressed store, hash-verified

532
533// Use use plugin
534func (db *DB) Use(plugin Plugin) error {
535 name := plugin.Name()
536 if _, ok := db.Plugins[name]; ok {
537 return ErrRegistered
538 }
539 if err := plugin.Initialize(db); err != nil {
540 return err
541 }
542 db.Plugins[name] = plugin
543 return nil
544}
545
546// ToSQL for generate SQL string.
547//

Callers

nothing calls this directly

Calls 2

NameMethod · 0.65
InitializeMethod · 0.65

Tested by

no test coverage detected