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

Method Remove

callbacks.go:234–240  ·  view source on GitHub ↗
(name string)

Source from the content-addressed store, hash-verified

232}
233
234func (c *callback) Remove(name string) error {
235 c.processor.db.Logger.Warn(context.Background(), "removing callback `%s` from %s\n", name, utils.FileWithLineNum())
236 c.name = name
237 c.remove = true
238 c.processor.callbacks = append(c.processor.callbacks, c)
239 return c.processor.compile()
240}
241
242func (c *callback) Replace(name string, fn func(*DB)) error {
243 c.processor.db.Logger.Info(context.Background(), "replacing callback `%s` from %s\n", name, utils.FileWithLineNum())

Callers 5

RemoveMethod · 0.45
TestLRURemoveOldestFunction · 0.45
TestCallbacksGetFunction · 0.45
TestCallbacksRemoveFunction · 0.45

Calls 3

FileWithLineNumFunction · 0.92
compileMethod · 0.80
WarnMethod · 0.65

Tested by 4

TestLRURemoveOldestFunction · 0.36
TestCallbacksGetFunction · 0.36
TestCallbacksRemoveFunction · 0.36