fix endpoint panic (#1291)

pull/1293/head
zwhyb 3 years ago committed by GitHub
parent 05e14e2a18
commit 5710bf0e30
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 7
      app.go

@ -69,7 +69,12 @@ func (a *App) Version() string { return a.opts.version }
func (a *App) Metadata() map[string]string { return a.opts.metadata } func (a *App) Metadata() map[string]string { return a.opts.metadata }
// Endpoint returns endpoints. // Endpoint returns endpoints.
func (a *App) Endpoint() []string { return a.instance.Endpoints } func (a *App) Endpoint() []string {
if a.instance == nil {
return []string{}
}
return a.instance.Endpoints
}
// Run executes all OnStart hooks registered with the application's Lifecycle. // Run executes all OnStart hooks registered with the application's Lifecycle.
func (a *App) Run() error { func (a *App) Run() error {

Loading…
Cancel
Save