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)
| 102 | // |
| 103 | // var s = auth.Must(auth.New[MyUser](config)) |
| 104 | func 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. |
no outgoing calls
no test coverage detected
searching dependent graphs…