Skip to content

Commit

Permalink
fix info
Browse files Browse the repository at this point in the history
Signed-off-by: kevindiu <[email protected]>
  • Loading branch information
kevindiu committed Jan 12, 2021
1 parent 2f3ccfe commit 237248d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
6 changes: 3 additions & 3 deletions internal/info/info.go
Original file line number Diff line number Diff line change
Expand Up @@ -90,15 +90,15 @@ var (
)

// Init initializes Detail object only once.
func Init(name string) error {
func Init(name string) {
i, err := New(WithServerName(name))
if err != nil {
return err
log.Init()
log.Fatal(errors.ErrFailedToInitInfo(err))
}
once.Do(func() {
infoProvider = i
})
return nil
}

// New initializes and returns the info object or any error occurred.
Expand Down
4 changes: 1 addition & 3 deletions internal/runner/runner.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,7 @@ func Do(ctx context.Context, opts ...Option) error {
opt(r)
}

if err := info.Init(r.name); err != nil {
return err
}
info.Init(r.name)

p, isHelp, err := params.New(
params.WithConfigFileDescription(fmt.Sprintf("%s config file path", r.name)),
Expand Down

0 comments on commit 237248d

Please sign in to comment.