mirror of
https://github.com/go-kratos/kratos.git
synced 2025-01-16 02:47:03 +02:00
fix endpoint panic (#1291)
This commit is contained in:
parent
05e14e2a18
commit
5710bf0e30
7
app.go
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 }
|
||||
|
||||
// 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.
|
||||
func (a *App) Run() error {
|
||||
|
Loading…
Reference in New Issue
Block a user