MCPcopy Create free account
hub / github.com/kataras/iris / Must

Function Must

auth/auth.go:104–110  ·  view source on GitHub ↗

Must is a helper that wraps a call to a function returning (*Auth[T], error) and panics if the error is non-nil. It is intended for use in variable initializations such as var s = auth.Must(auth.New[MyUser](config))

(s *Auth[T], err error)

Source from the content-addressed store, hash-verified

102//
103// var s = auth.Must(auth.New[MyUser](config))
104func Must[T User](s *Auth[T], err error) *Auth[T] {
105 if err != nil {
106 panic(err)
107 }
108
109 return s
110}
111
112// New initializes a new Auth instance typeof T and returns it.
113// The T generic can be any custom struct.

Callers 1

MustLoadFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…