MCPcopy Create free account
hub / github.com/TheThingsNetwork/lorawan-stack / MustNew

Function MustNew

pkg/component/component.go:248–254  ·  view source on GitHub ↗

MustNew calls New and returns a new component or panics on an error. In most cases, you should just use New.

(logger log.Stack, config *Config, opts ...Option)

Source from the content-addressed store, hash-verified

246// MustNew calls New and returns a new component or panics on an error.
247// In most cases, you should just use New.
248func MustNew(logger log.Stack, config *Config, opts ...Option) *Component {
249 c, err := New(logger, config, opts...)
250 if err != nil {
251 panic(err)
252 }
253 return c
254}
255
256// Logger returns the logger of the component.
257func (c *Component) Logger() log.Stack {

Callers 5

TestNewFunction · 0.92
TestListenUDPFunction · 0.92
TestInteropTLSFunction · 0.92
TestGenerateDataDownlinkFunction · 0.92
TestRunFunction · 0.85

Calls 1

NewFunction · 0.70

Tested by 5

TestNewFunction · 0.74
TestListenUDPFunction · 0.74
TestInteropTLSFunction · 0.74
TestGenerateDataDownlinkFunction · 0.74
TestRunFunction · 0.68