MCPcopy
hub / github.com/larksuite/cli / MustBuild

Method MustBuild

extension/platform/builder.go:178–184  ·  view source on GitHub ↗

MustBuild panics if Build() would return an error. Designed for init(): func init() { platform.Register(platform.NewPlugin(...).MustBuild()) } A panic in init runs before the framework's recover guard is installed and will crash the binary. That is the intended behaviour: a misconfigured plugin m

()

Source from the content-addressed store, hash-verified

176// installed and will crash the binary. That is the intended
177// behaviour: a misconfigured plugin must NOT be silently registered.
178func (b *Builder) MustBuild() Plugin {
179 p, err := b.Build()
180 if err != nil {
181 panic(fmt.Sprintf("plugin %q: %v", b.name, err))
182 }
183 return p
184}
185
186// validateHookName checks the grammar and uniqueness; returns false
187// when the name was rejected (caller skips the action).

Callers 3

initFunction · 0.80
initFunction · 0.80

Calls 1

BuildMethod · 0.95

Tested by 1