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

Method Replace

callbacks.go:242–249  ·  view source on GitHub ↗
(name string, fn func(*DB))

Source from the content-addressed store, hash-verified

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())
244 c.name = name
245 c.handler = fn
246 c.replace = true
247 c.processor.callbacks = append(c.processor.callbacks, c)
248 return c.processor.compile()
249}
250
251// getRIndex get right index from string slice
252func getRIndex(strs []string, str string) int {

Callers

nothing calls this directly

Calls 3

FileWithLineNumFunction · 0.92
compileMethod · 0.80
InfoMethod · 0.65

Tested by

no test coverage detected