Skip to content

Commit

Permalink
fix: NewApp slice parameter to func(*AmfApp)
Browse files Browse the repository at this point in the history
  • Loading branch information
donald1218 committed Apr 24, 2024
1 parent 9140d0a commit 067f07f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion cmd/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ func action(cliCtx *cli.Context) error {
callback.SendAmfStatusChangeNotify((string)(models.StatusChange_UNAVAILABLE), amfSelf.ServedGuamiList)
}

amf, err := service.NewApp(cfg, ([]func(*service.AmfApp){appStart, appStop}))
amf, err := service.NewApp(cfg, appStart, appStop)
if err != nil {
return err
}
Expand Down
6 changes: 3 additions & 3 deletions pkg/service/init.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,11 @@ func GetApp() *AmfApp {
return AMF
}

func NewApp(cfg *factory.Config, funcs []func(*AmfApp)) (*AmfApp, error) {
func NewApp(cfg *factory.Config, startFunc, terminateFunc func(*AmfApp)) (*AmfApp, error) {
amf := &AmfApp{
cfg: cfg,
start: funcs[0],
stop: funcs[1],
start: startFunc,
stop: terminateFunc,
}
amf.SetLogEnable(cfg.GetLogEnable())
amf.SetLogLevel(cfg.GetLogLevel())
Expand Down

0 comments on commit 067f07f

Please sign in to comment.